Skip to content

Commit 47fa009

Browse files
committed
⬆️ Update eslint to v10
1 parent 3a6fa86 commit 47fa009

File tree

4 files changed

+78
-72
lines changed

4 files changed

+78
-72
lines changed

.eslintrc

Lines changed: 0 additions & 70 deletions
This file was deleted.

eslint.config.js

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import { defineConfig } from 'eslint/config';
2+
import js from '@eslint/js';
3+
import globals from 'globals';
4+
import stylistic from '@stylistic/eslint-plugin';
5+
6+
export default defineConfig([
7+
js.configs.recommended,
8+
{
9+
languageOptions: {
10+
globals: {
11+
...globals.node,
12+
},
13+
ecmaVersion: 2025,
14+
sourceType: 'module',
15+
parserOptions: {
16+
ecmaFeatures: {
17+
impliedStrict: true,
18+
},
19+
},
20+
},
21+
plugins: {
22+
'@stylistic': stylistic
23+
},
24+
rules: {
25+
'@stylistic/semi': 1,
26+
'@stylistic/semi-style': 2,
27+
'@stylistic/semi-spacing': 1,
28+
'@stylistic/quotes': ['warn', 'single', {
29+
avoidEscape: true,
30+
allowTemplateLiterals: 'never',
31+
}],
32+
'@stylistic/brace-style': 2,
33+
'@stylistic/indent': ['error', 2],
34+
'@stylistic/spaced-comment': 1,
35+
'@stylistic/no-multi-spaces': 1,
36+
'@stylistic/wrap-iife': ['error', 'inside'],
37+
'@stylistic/linebreak-style': 1,
38+
'@stylistic/template-curly-spacing': 1,
39+
40+
'camelcase': 2,
41+
'eqeqeq': ['error', 'smart'],
42+
'curly': ['error', 'all'],
43+
'dot-notation': 2,
44+
'no-array-constructor': 2,
45+
'no-throw-literal': 2,
46+
'no-self-compare': 2,
47+
'no-useless-call': 1,
48+
'consistent-return': 2,
49+
'no-new-wrappers': 2,
50+
'no-script-url': 2,
51+
'no-console': 1,
52+
'no-void': 1,
53+
'vars-on-top': 1,
54+
'yoda': ['error', 'never'],
55+
/* 'no-warning-comments': 1, */ // should be enabled later
56+
'require-await': 1,
57+
'no-loop-func': 2,
58+
'no-eval': 2,
59+
'no-implied-eval': 2,
60+
'no-var': 1,
61+
'prefer-const': 2,
62+
'prefer-arrow-callback': 1,
63+
'prefer-rest-params': 2,
64+
'prefer-spread': 2,
65+
'prefer-template': 1,
66+
'symbol-description': 2,
67+
'object-shorthand': 1,
68+
'prefer-promise-reject-errors': 2,
69+
/* 'prefer-destructuring': 1, */ // https://github.com/eslint/eslint/issues/10250
70+
'no-object-constructor': 2,
71+
},
72+
}
73+
]);

lib/dependencies.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function packages(config, dependencies) {
3838
information.push(
3939
info(config, dependency, versions.clean(version))
4040
);
41-
} catch (e) {
41+
} catch {
4242
/* eslint-disable no-console */
4343
console.log(chalk.bgRed.bold(
4444
'Something went wrong during requesting the information from the server.\nAre you sure you are connected to the internet?'

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,12 @@
2626
"semver": "^7.6.3"
2727
},
2828
"devDependencies": {
29+
"@eslint/js": "^10.0.1",
30+
"@stylistic/eslint-plugin": "^5.10.0",
2931
"c8": "^10.1.2",
3032
"chai": "^5.1.1",
31-
"eslint": "^8.57.0",
33+
"eslint": "^10.0.3",
34+
"globals": "^17.4.0",
3235
"mocha": "^10.7.3"
3336
},
3437
"repository": {

0 commit comments

Comments
 (0)