Skip to content

Commit 3f5f8c6

Browse files
committed
chore: upgrade & configure eslint to v9
1 parent eec361e commit 3f5f8c6

File tree

5 files changed

+791
-455
lines changed

5 files changed

+791
-455
lines changed

.eslintignore

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

.eslintrc.cjs

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

eslint.config.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import { FlatCompat } from '@eslint/eslintrc';
2+
import prettierConfig from 'eslint-config-prettier/flat';
3+
import prettierPlugin from 'eslint-plugin-prettier/recommended';
4+
import sonarjs from 'eslint-plugin-sonarjs';
5+
import unicorn from 'eslint-plugin-unicorn';
6+
import tseslint from 'typescript-eslint';
7+
8+
const compat = new FlatCompat({
9+
baseDirectory: import.meta.dirname
10+
});
11+
12+
export default tseslint.config(
13+
{
14+
ignores: ['.next']
15+
},
16+
...compat.config({
17+
/**
18+
* Under the hood 'next' automatically configures:
19+
* - eslint-plugin-next
20+
* - eslint-plugin-react
21+
* - eslint-plugin-react-hooks
22+
* - eslint-plugin-jsx-a11y
23+
*/
24+
extends: ['next'],
25+
plugins: ['@tanstack/query']
26+
}),
27+
prettierConfig,
28+
prettierPlugin,
29+
sonarjs.configs.recommended,
30+
unicorn.configs.recommended,
31+
{
32+
files: ['**/*.ts', '**/*.tsx'],
33+
extends: [
34+
...tseslint.configs.strict,
35+
...tseslint.configs.strictTypeChecked,
36+
...tseslint.configs.stylistic,
37+
...tseslint.configs.stylisticTypeChecked
38+
],
39+
rules: {
40+
'@typescript-eslint/array-type': 'off',
41+
'@typescript-eslint/consistent-type-definitions': 'off',
42+
'@typescript-eslint/consistent-type-imports': [
43+
'warn',
44+
{ prefer: 'type-imports', fixStyle: 'inline-type-imports' }
45+
],
46+
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
47+
'@typescript-eslint/require-await': 'off',
48+
'@typescript-eslint/no-misused-promises': [
49+
'error',
50+
{ checksVoidReturn: { attributes: false } }
51+
]
52+
}
53+
},
54+
{
55+
linterOptions: {
56+
reportUnusedDisableDirectives: true
57+
},
58+
languageOptions: {
59+
parserOptions: {
60+
projectService: true
61+
}
62+
}
63+
}
64+
);

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,36 +56,35 @@
5656
"devDependencies": {
5757
"@commitlint/cli": "19.8.0",
5858
"@commitlint/config-conventional": "19.8.0",
59+
"@eslint/eslintrc": "3.3.1",
5960
"@ianvs/prettier-plugin-sort-imports": "4.4.1",
61+
"@next/eslint-plugin-next": "15.3.2",
6062
"@playwright/test": "1.52.0",
6163
"@tanstack/eslint-plugin-query": "5.74.7",
6264
"@total-typescript/ts-reset": "0.6.1",
63-
"@types/eslint": "9.6.1",
6465
"@types/node": "22.15.15",
6566
"@types/qrcode": "1.5.5",
6667
"@types/react": "19.1.3",
6768
"@types/react-dom": "19.1.3",
68-
"@typescript-eslint/eslint-plugin": "8.32.0",
69-
"@typescript-eslint/parser": "8.32.0",
7069
"autoprefixer": "10.4.21",
7170
"cssnano": "7.0.7",
72-
"eslint": "8.57.0",
71+
"eslint": "9.26.0",
7372
"eslint-config-next": "15.3.2",
7473
"eslint-config-prettier": "10.1.3",
7574
"eslint-plugin-jsx-a11y": "6.10.2",
7675
"eslint-plugin-prettier": "5.4.0",
77-
"eslint-plugin-promise": "7.2.1",
7876
"eslint-plugin-react": "7.37.5",
7977
"eslint-plugin-react-hooks": "5.2.0",
80-
"eslint-plugin-sonarjs": "0.25.1",
81-
"eslint-plugin-unicorn": "56.0.1",
78+
"eslint-plugin-sonarjs": "3.0.2",
79+
"eslint-plugin-unicorn": "59.0.1",
8280
"husky": "9.1.7",
8381
"lint-staged": "15.5.2",
8482
"postcss": "8.5.3",
8583
"prettier": "3.5.3",
8684
"prettier-plugin-tailwindcss": "0.6.11",
8785
"sass": "1.87.0",
8886
"tailwindcss": "3.4.17",
89-
"typescript": "5.8.3"
87+
"typescript": "5.8.3",
88+
"typescript-eslint": "8.32.0"
9089
}
9190
}

0 commit comments

Comments
 (0)