Enable eslint rule "object-curly-spacing"
This commit is contained in:
parent
25e5703e1a
commit
44fdb443f8
6 changed files with 7 additions and 6 deletions
|
@ -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
|
||||
},
|
||||
};
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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));
|
||||
})
|
||||
);
|
||||
|
|
|
@ -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));
|
||||
})
|
||||
);
|
||||
|
|
|
@ -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));
|
||||
})
|
||||
);
|
||||
|
|
|
@ -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' } : {};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue