From 44fdb443f8fb489669d361c06e16d559d753c37c Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Mon, 9 Jan 2023 07:00:26 -0300 Subject: [PATCH] Enable eslint rule "object-curly-spacing" --- .eslintrc.js | 3 ++- src/js/lib/WebPackage.ts | 2 +- src/js/lib/WebPackage/CSSLoader.ts | 2 +- src/js/lib/WebPackage/OtherLoader.ts | 2 +- src/js/lib/WebPackage/ScriptLoader.ts | 2 +- src/js/lib/WebPackage/fetchOptions.ts | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index d617f39..3da5e5f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -17,6 +17,7 @@ module.exports = { "@typescript-eslint/no-redeclare": 0, "no-return-assign": 0, "no-useless-return": 0, - "quotes": 2 + "quotes": 2, + "object-curly-spacing": 2 }, }; diff --git a/src/js/lib/WebPackage.ts b/src/js/lib/WebPackage.ts index f05f3cf..4e6c580 100644 --- a/src/js/lib/WebPackage.ts +++ b/src/js/lib/WebPackage.ts @@ -12,7 +12,7 @@ import OtherLoader from './WebPackage/OtherLoader'; export default function (pkgspec: PackageSpec): WebPackage { const self: WebPackage = Object.create(null); - const pkg: Package = {fonts: [], images: [], stylesheets: [], scripts: [], others: []}; + const pkg: Package = { fonts: [], images: [], stylesheets: [], scripts: [], others: [] }; const { fonts, images, stylesheets, scripts, others, onprogress } = pkgspec; const total = [...fonts, ...images, ...stylesheets, ...scripts].length; diff --git a/src/js/lib/WebPackage/CSSLoader.ts b/src/js/lib/WebPackage/CSSLoader.ts index 38cefb4..2db3a20 100644 --- a/src/js/lib/WebPackage/CSSLoader.ts +++ b/src/js/lib/WebPackage/CSSLoader.ts @@ -9,7 +9,7 @@ export default function( (stylesheets || []).map((href) => { return fetch(href, fetchOptions()) .then((res) => res.text()) - .then((innerText) => Object.assign(document.createElement('style'), {innerText})) + .then((innerText) => Object.assign(document.createElement('style'), { innerText })) .then((el) => reporter(el)); }) ); diff --git a/src/js/lib/WebPackage/OtherLoader.ts b/src/js/lib/WebPackage/OtherLoader.ts index b5e89d8..e608fc9 100644 --- a/src/js/lib/WebPackage/OtherLoader.ts +++ b/src/js/lib/WebPackage/OtherLoader.ts @@ -9,7 +9,7 @@ export default function( (others || []).map((src) => { return fetch(src, fetchOptions()) .then((res) => res.text()) - .then((text) => Object.assign(document.createElement('script'), {type: 'text/plain', src, text})) + .then((text) => Object.assign(document.createElement('script'), { type: 'text/plain', src, text })) .then((el) => reporter(el)); }) ); diff --git a/src/js/lib/WebPackage/ScriptLoader.ts b/src/js/lib/WebPackage/ScriptLoader.ts index 4be5e9a..305faba 100644 --- a/src/js/lib/WebPackage/ScriptLoader.ts +++ b/src/js/lib/WebPackage/ScriptLoader.ts @@ -9,7 +9,7 @@ export default function( (scripts || []).map((src) => { return fetch(src, fetchOptions()) .then((res) => res.text()) - .then((text) => Object.assign(document.createElement('script'), {type: 'application/javascript', text})) + .then((text) => Object.assign(document.createElement('script'), { type: 'application/javascript', text })) .then((el) => reporter(el)); }) ); diff --git a/src/js/lib/WebPackage/fetchOptions.ts b/src/js/lib/WebPackage/fetchOptions.ts index d9a9dc0..201c00b 100644 --- a/src/js/lib/WebPackage/fetchOptions.ts +++ b/src/js/lib/WebPackage/fetchOptions.ts @@ -4,5 +4,5 @@ const getNavigationEntries = (): PerformanceNavigationTiming[] => { export function fetchOptions(): RequestInit { const pageHasRefreshed = getNavigationEntries().some((e) => e.type === 'reload'); - return pageHasRefreshed ? {cache: 'reload'} : {}; + return pageHasRefreshed ? { cache: 'reload' } : {}; }