Skip to content

Commit f7aa1d1

Browse files
authored
Update eslint to v9 (#10)
1 parent 267a29d commit f7aa1d1

File tree

2 files changed

+61
-7
lines changed

2 files changed

+61
-7
lines changed

eslint.config.mjs

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import importX from 'eslint-plugin-import-x';
2+
import jsdoc from 'eslint-plugin-jsdoc';
3+
import regexp from 'eslint-plugin-regexp';
4+
import neostandard, { plugins as neostdplugins } from 'neostandard';
5+
import globals from 'globals';
6+
7+
export default [
8+
{
9+
ignores: ['src/lib', 'src/web-ext-config.cjs']
10+
},
11+
jsdoc.configs['flat/recommended'],
12+
regexp.configs['flat/recommended'],
13+
...neostandard({
14+
semi: true
15+
}),
16+
{
17+
plugins: {
18+
'@stylistic': neostdplugins['@stylistic'],
19+
'import-x': importX,
20+
regexp
21+
},
22+
linterOptions: {
23+
reportUnusedDisableDirectives: true
24+
},
25+
languageOptions: {
26+
globals: {
27+
...globals.node
28+
},
29+
ecmaVersion: 'latest',
30+
sourceType: 'module'
31+
},
32+
rules: {
33+
'@stylistic/space-before-function-paren': ['error', {
34+
anonymous: 'always',
35+
asyncArrow: 'always',
36+
named: 'never'
37+
}],
38+
'import-x/order': ['error', {
39+
alphabetize: {
40+
order: 'ignore',
41+
caseInsensitive: false
42+
}
43+
}],
44+
'no-await-in-loop': 'error',
45+
'no-use-before-define': ['error', {
46+
allowNamedExports: false,
47+
classes: true,
48+
functions: true,
49+
variables: true
50+
}]
51+
}
52+
}
53+
];

package.json

+8-7
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@
1313
"main": "index.js",
1414
"types": "types/index.d.ts",
1515
"devDependencies": {
16-
"c8": "^9.1.0",
16+
"c8": "^10.1.2",
1717
"chai": "^5.1.1",
18-
"eslint": "^8.57.0",
19-
"eslint-config-standard": "^17.1.0",
20-
"eslint-plugin-import": "^2.29.1",
21-
"eslint-plugin-jsdoc": "^48.2.7",
18+
"eslint": "^9.11.1",
19+
"eslint-plugin-import-x": "^4.3.0",
20+
"eslint-plugin-jsdoc": "^50.3.0",
2221
"eslint-plugin-regexp": "^2.6.0",
23-
"mocha": "^10.4.0",
24-
"typescript": "^5.4.5"
22+
"globals": "^15.9.0",
23+
"mocha": "^10.7.3",
24+
"neostandard": "^0.11.6",
25+
"typescript": "^5.6.2"
2526
},
2627
"scripts": {
2728
"build": "npm run tsc && npm run lint && npm run test",

0 commit comments

Comments
 (0)