Skip to content

Commit

Permalink
Update linting to latest (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
soulgalore authored Dec 28, 2024
1 parent 73d2af0 commit a8f8816
Show file tree
Hide file tree
Showing 10 changed files with 588 additions and 558 deletions.
5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

23 changes: 0 additions & 23 deletions .eslintrc.json

This file was deleted.

54 changes: 54 additions & 0 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
const prettier = require('eslint-plugin-prettier');
const globals = require('globals');
const js = require('@eslint/js');
const { FlatCompat } = require('@eslint/eslintrc');

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

module.exports = [
{
ignores: ['**/dist/', '**/node_modules/', '**/test/', '**/tools/']
},
...compat.extends('eslint:recommended'),
{
plugins: {
prettier
},

languageOptions: {
globals: {
...globals.node
},

ecmaVersion: 2018,
sourceType: 'commonjs'
},

rules: {
'prettier/prettier': [
'error',
{
singleQuote: true,
trailingComma: 'none'
}
],

'no-extra-semi': 0,
'no-mixed-spaces-and-tabs': 0,
'no-prototype-builtins': 0
}
},
{
files: ['lib/dom/**'],
languageOptions: {
globals: {
...globals.browser,
util: true
}
}
}
];
2 changes: 0 additions & 2 deletions lib/dom/.eslintrc

This file was deleted.

3 changes: 2 additions & 1 deletion lib/dom/info/localStorageSize.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
}
try {
return storageSize(window.localStorage);
} catch (error) {
// eslint-disable-next-line no-unused-vars
} catch (e) {
return 'Could not access localStorage.';
}
})();
3 changes: 2 additions & 1 deletion lib/dom/info/sessionStorageSize.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

try {
return storageSize(window.sessionStorage);
} catch (error) {
// eslint-disable-next-line no-unused-vars
} catch (e) {
return 'Could not access sessionStorage';
}
})();
1 change: 1 addition & 0 deletions lib/har/info/technology.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ module.exports = {
html
});
return Wappalyzer.resolve(detections);
// eslint-disable-next-line no-unused-vars
} catch (e) {
return {};
}
Expand Down
2 changes: 2 additions & 0 deletions lib/har/thirdParty.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module.exports.getThirdParty = function (page) {
page && page.url.indexOf('localhost') > -1
? undefined
: getEntity(page.url);
// eslint-disable-next-line no-unused-vars
} catch (e) {
// https://github.com/sitespeedio/sitespeed.io/issues/3043
}
Expand All @@ -27,6 +28,7 @@ module.exports.getThirdParty = function (page) {
(asset && !asset.url.startsWith('http'))
? undefined
: getEntity(asset.url);
// eslint-disable-next-line no-unused-vars
} catch (e) {
continue;
}
Expand Down
Loading

0 comments on commit a8f8816

Please sign in to comment.