Skip to content

Commit dabd994

Browse files
committed
chore: upgrade ESLint 9
1 parent 261d63f commit dabd994

File tree

6 files changed

+1165
-825
lines changed

6 files changed

+1165
-825
lines changed

.eslintignore

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

.eslintrc.cjs

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

eslint.config.js

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// @ts-check
2+
import { builtinModules } from 'node:module';
3+
import tseslint from 'typescript-eslint';
4+
import importX from 'eslint-plugin-import-x';
5+
// @ts-expect-error missing types
6+
import eslint from '@eslint/js';
7+
// @ts-expect-error missing types
8+
import eslintConfigPrettier from 'eslint-config-prettier';
9+
10+
export default tseslint.config(
11+
eslint.configs.recommended,
12+
{
13+
files: ['**/*.js', '**/*.ts', '**/*.tsx'],
14+
extends: [...tseslint.configs.recommended],
15+
plugins: {
16+
import: importX,
17+
},
18+
19+
languageOptions: {
20+
parserOptions: {
21+
sourceType: 'module',
22+
ecmaFeatures: {
23+
jsx: true,
24+
},
25+
},
26+
},
27+
28+
rules: {
29+
eqeqeq: ['warn', 'always', { null: 'never' }],
30+
'no-debugger': ['error'],
31+
'no-empty': ['warn', { allowEmptyCatch: true }],
32+
'prefer-const': [
33+
'warn',
34+
{
35+
destructuring: 'all',
36+
},
37+
],
38+
'@typescript-eslint/ban-ts-comment': 'off',
39+
'@typescript-eslint/no-var-requires': 'off',
40+
'@typescript-eslint/no-non-null-assertion': 'off',
41+
'@typescript-eslint/no-explicit-any': 'off',
42+
'@typescript-eslint/consistent-type-imports': [
43+
'error',
44+
{ prefer: 'type-imports', fixStyle: 'inline-type-imports' },
45+
],
46+
47+
'import/no-nodejs-modules': [
48+
'error',
49+
{ allow: builtinModules.map((mod) => `node:${mod}`) },
50+
],
51+
'import/no-duplicates': 'error',
52+
'import/order': 'error',
53+
'sort-imports': [
54+
'error',
55+
{
56+
ignoreCase: false,
57+
ignoreDeclarationSort: true,
58+
ignoreMemberSort: false,
59+
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
60+
allowSeparatedGroups: false,
61+
},
62+
],
63+
},
64+
},
65+
eslintConfigPrettier,
66+
{
67+
ignores: ['**/dist/', '**/coverage/'],
68+
}
69+
);

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,24 @@
2020
],
2121
"devDependencies": {
2222
"@babel/plugin-syntax-typescript": "^7.23.3",
23+
"@eslint/js": "^9.3.0",
2324
"@rollup/plugin-babel": "^6.0.4",
2425
"@types/babel__core": "^7.20.5",
2526
"@types/babel__helper-module-imports": "^7.18.3",
2627
"@types/babel__helper-plugin-utils": "^7.10.3",
2728
"@types/node": "^20.11.16",
28-
"@typescript-eslint/eslint-plugin": "^7.0.1",
2929
"@vitest/coverage-v8": "^1.2.2",
3030
"@vue/babel-plugin-jsx": "workspace:*",
3131
"bumpp": "^9.3.0",
32-
"eslint": "^8.56.0",
32+
"eslint": "^9.3.0",
3333
"eslint-config-prettier": "^9.1.0",
34-
"eslint-plugin-import": "^2.29.1",
34+
"eslint-plugin-import-x": "^0.5.0",
3535
"jsdom": "^24.0.0",
3636
"prettier": "^3.2.5",
37+
"tslib": "^2.6.2",
3738
"tsup": "^8.0.1",
3839
"typescript": "^5.3.3",
40+
"typescript-eslint": "^7.10.0",
3941
"vite": "^5.0.12",
4042
"vitest": "^1.2.2"
4143
}

packages/babel-plugin-jsx/test/index.test.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -482,11 +482,8 @@ test('reassign variable as component should work', () => {
482482
},
483483
});
484484

485-
/* eslint-disable */
486485
const _a2 = 2;
487486
a = _a2;
488-
/* eslint-enable */
489-
490487
a = <A>{a}</A>;
491488

492489
const wrapper = mount({

0 commit comments

Comments
 (0)