Skip to content

Commit

Permalink
Update eslint to v9 (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
asamuzaK authored Sep 28, 2024
1 parent 87b5be0 commit 1811b10
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 43 deletions.
39 changes: 0 additions & 39 deletions .eslintrc

This file was deleted.

58 changes: 58 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import importX from 'eslint-plugin-import-x';
import jsdoc from 'eslint-plugin-jsdoc';
import regexp from 'eslint-plugin-regexp';
import unicorn from 'eslint-plugin-unicorn';
import neostandard, { plugins as neostdplugins } from 'neostandard';
import globals from 'globals';

export default [
{
ignores: ['src/lib', 'src/web-ext-config.cjs']
},
jsdoc.configs['flat/recommended'],
regexp.configs['flat/recommended'],
...neostandard({
semi: true
}),
{
plugins: {
'@stylistic': neostdplugins['@stylistic'],
'import-x': importX,
regexp,
unicorn
},
linterOptions: {
reportUnusedDisableDirectives: true
},
languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.webextensions
},
ecmaVersion: 'latest',
sourceType: 'module'
},
rules: {
'@stylistic/space-before-function-paren': ['error', {
anonymous: 'always',
asyncArrow: 'always',
named: 'never'
}],
'import-x/order': ['error', {
alphabetize: {
order: 'ignore',
caseInsensitive: false
}
}],
'no-await-in-loop': 'error',
'no-use-before-define': ['error', {
allowNamedExports: false,
classes: true,
functions: true,
variables: true
}],
'unicorn/prefer-node-protocol': 'error'
}
}
];
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@
"@types/sinon": "^17.0.3",
"c8": "^10.1.2",
"chai": "^5.1.1",
"eslint": "^8.57.0",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.30.0",
"eslint": "^9.11.1",
"eslint-plugin-import-x": "^4.3.0",
"eslint-plugin-jsdoc": "^50.3.0",
"eslint-plugin-regexp": "^2.6.0",
"eslint-plugin-unicorn": "^55.0.0",
"globals": "^15.9.0",
"mocha": "^10.7.3",
"neostandard": "^0.11.6",
"npm-run-all": "^4.1.5",
"typescript": "^5.6.2",
"undici": "^6.19.8"
Expand Down
2 changes: 1 addition & 1 deletion test/browser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { afterEach, beforeEach, describe, it } from 'mocha';
import { browser } from './mocha/setup.js';

/* test */
// eslint-disable-next-line import/order
// eslint-disable-next-line import-x/order
import * as mjs from '../modules/browser.js';

describe('browser', () => {
Expand Down

0 comments on commit 1811b10

Please sign in to comment.