Skip to content

Commit 4df98ae

Browse files
authored
Update eslint dependencies (#3877)
* Sort rules * Migrate to `@eslint-react/eslint-plugin` * Use prettier to format everything * Disable formatting
1 parent 20d6730 commit 4df98ae

File tree

4 files changed

+35
-37
lines changed

4 files changed

+35
-37
lines changed

.prettierignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
*.js
2-
*.json
3-
*.css
1+
package.json
42
/website/routeTree.gen.ts

biome.json

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3+
"assist": { "actions": { "source": { "organizeImports": "off" } } },
34
"files": {
45
"includes": [
56
"**",
@@ -16,33 +17,19 @@
1617
]
1718
},
1819
"formatter": {
19-
"includes": ["**", "!**/*.ts", "!**/*.tsx", "!package.json"],
20-
"indentStyle": "space",
21-
"lineWidth": 100
20+
"enabled": false
2221
},
2322
"json": {
2423
"parser": {
2524
"allowComments": true,
2625
"allowTrailingCommas": true
2726
}
2827
},
29-
"javascript": {
30-
"formatter": {
31-
"quoteStyle": "single",
32-
"trailingCommas": "none"
33-
}
34-
},
35-
"css": {
36-
"formatter": {
37-
"quoteStyle": "single"
38-
}
39-
},
4028
"linter": {
4129
"domains": {
4230
"project": "recommended"
4331
},
4432
"rules": {
45-
"recommended": false,
4633
"a11y": {
4734
"noAccessKey": "warn",
4835
"noAriaHiddenOnFocusable": "warn",
@@ -193,8 +180,8 @@
193180
"useSingleJsDocAsterisk": "warn",
194181
"useUniqueElementIds": "off",
195182
"useValidForDirection": "warn",
196-
"useYield": "warn",
197-
"useValidTypeof": "warn"
183+
"useValidTypeof": "warn",
184+
"useYield": "warn"
198185
},
199186
"performance": {
200187
"noAccumulatingSpread": "warn",
@@ -206,6 +193,7 @@
206193
"noReExportAll": "off",
207194
"useTopLevelRegex": "warn"
208195
},
196+
"recommended": false,
209197
"security": {
210198
"noBlankTarget": "warn",
211199
"noDangerouslySetInnerHtml": "warn",
@@ -215,15 +203,16 @@
215203
"style": {
216204
"noDefaultExport": "off",
217205
"noDoneCallback": "warn",
218-
"noExportedImports": "off",
219206
"noEnum": "off",
207+
"noExportedImports": "off",
220208
"noImplicitBoolean": "off",
221209
"noInferrableTypes": "warn",
222210
"noNamespace": "warn",
223211
"noNegationElse": "warn",
224212
"noNonNullAssertion": "off",
225213
"noParameterAssign": "off",
226214
"noParameterProperties": "warn",
215+
"noRestrictedGlobals": "warn",
227216
"noRestrictedImports": {
228217
"level": "warn",
229218
"options": {
@@ -239,7 +228,6 @@
239228
}
240229
}
241230
},
242-
"noRestrictedGlobals": "warn",
243231
"noShoutyConstants": "warn",
244232
"noSubstr": "off",
245233
"noUnusedTemplateLiteral": "warn",
@@ -250,8 +238,8 @@
250238
"useAtIndex": "off",
251239
"useBlockStatements": "off",
252240
"useCollapsedElseIf": "warn",
253-
"useComponentExportOnlyModules": "off",
254241
"useCollapsedIf": "warn",
242+
"useComponentExportOnlyModules": "off",
255243
"useConsistentArrayType": "warn",
256244
"useConsistentBuiltinInstantiation": "warn",
257245
"useConsistentObjectDefinitions": "warn",
@@ -361,7 +349,6 @@
361349
}
362350
}
363351
},
364-
"assist": { "actions": { "source": { "organizeImports": "off" } } },
365352
"overrides": [
366353
{
367354
"includes": ["**/*.test.*"],
@@ -385,6 +372,14 @@
385372
}
386373
}
387374
}
375+
},
376+
{
377+
"assist": {
378+
"actions": {
379+
"source": { "useSortedKeys": "on" }
380+
}
381+
},
382+
"includes": ["./biome.json"]
388383
}
389384
]
390385
}

eslint.config.js

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1+
import reactX from '@eslint-react/eslint-plugin';
2+
import markdown from '@eslint/markdown';
13
import typescriptEslint from '@typescript-eslint/eslint-plugin';
24
import tsParser from '@typescript-eslint/parser';
35
import vitest from '@vitest/eslint-plugin';
4-
import { defineConfig, globalIgnores } from 'eslint/config';
56
import jestDom from 'eslint-plugin-jest-dom';
67
import react from 'eslint-plugin-react';
78
import reactCompiler from 'eslint-plugin-react-compiler';
89
import reactHooks from 'eslint-plugin-react-hooks';
9-
import reactHooksExtra from 'eslint-plugin-react-hooks-extra';
1010
import sonarjs from 'eslint-plugin-sonarjs';
1111
import testingLibrary from 'eslint-plugin-testing-library';
12-
import markdown from '@eslint/markdown';
12+
import { defineConfig, globalIgnores } from 'eslint/config';
1313

1414
export default defineConfig([
1515
globalIgnores(['.cache', '.nitro', '.output', '.tanstack', 'coverage', 'dist', 'lib']),
@@ -28,7 +28,7 @@ export default defineConfig([
2828
react,
2929
'react-compiler': reactCompiler,
3030
'react-hooks': reactHooks,
31-
'react-hooks-extra': reactHooksExtra,
31+
'react-x': reactX,
3232
sonarjs,
3333
'@typescript-eslint': typescriptEslint
3434
},
@@ -249,6 +249,7 @@ export default defineConfig([
249249
'prefer-rest-params': 1,
250250
'prefer-spread': 1,
251251
'prefer-template': 1,
252+
'preserve-caught-error': 1,
252253
radix: 1,
253254
'require-await': 0, // replaced by @typescript-eslint/require-await
254255
'require-unicode-regexp': 0,
@@ -393,10 +394,10 @@ export default defineConfig([
393394

394395
// React Hooks Extra
395396
// https://eslint-react.xyz/
396-
'react-hooks-extra/no-unnecessary-use-callback': 1,
397-
'react-hooks-extra/no-unnecessary-use-memo': 1,
398-
'react-hooks-extra/no-unnecessary-use-prefix': 1,
399-
'react-hooks-extra/prefer-use-state-lazy-initialization': 1,
397+
'react-x/no-unnecessary-use-callback': 1,
398+
'react-x/no-unnecessary-use-memo': 1,
399+
'react-x/no-unnecessary-use-prefix': 1,
400+
'react-x/prefer-use-state-lazy-initialization': 1,
400401

401402
// SonarJS rules
402403
// https://github.com/SonarSource/eslint-plugin-sonarjs#rules
@@ -606,6 +607,7 @@ export default defineConfig([
606607
'vitest/consistent-test-filename': 0,
607608
'vitest/consistent-test-it': 1,
608609
'vitest/expect-expect': 0,
610+
'vitest/hoisted-apis-on-top': 1,
609611
'vitest/max-expects': 0,
610612
'vitest/max-nested-describe': 0,
611613
'vitest/no-alias-methods': 1,
@@ -755,7 +757,10 @@ export default defineConfig([
755757
'markdown/no-missing-atx-heading-space': 1,
756758
'markdown/no-missing-label-refs': 1,
757759
'markdown/no-missing-link-fragments': 1,
760+
'markdown/no-multiple-h1': 1,
761+
'markdown/no-reference-like-urls': 1,
758762
'markdown/no-reversed-media-syntax': 1,
763+
'markdown/no-space-in-emphasis': 1,
759764
'markdown/no-unused-definitions': 1,
760765
'markdown/require-alt-text': 1,
761766
'markdown/table-column-count': 1

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@
5454
"devDependencies": {
5555
"@babel/preset-typescript": "^7.27.1",
5656
"@biomejs/biome": "2.2.4",
57-
"@eslint/markdown": "^7.1.0",
57+
"@eslint-react/eslint-plugin": "^2.0.2",
58+
"@eslint/markdown": "^7.3.0",
5859
"@faker-js/faker": "^10.0.0",
5960
"@ianvs/prettier-plugin-sort-imports": "^4.6.2",
6061
"@linaria/core": "^6.3.0",
@@ -71,14 +72,13 @@
7172
"@vitest/eslint-plugin": "^1.3.4",
7273
"@wyw-in-js/rollup": "^0.7.0",
7374
"@wyw-in-js/vite": "^0.7.0",
74-
"eslint": "^9.34.0",
75+
"eslint": "^9.36.0",
7576
"eslint-plugin-jest-dom": "^5.5.0",
76-
"eslint-plugin-react": "^7.37.4",
77+
"eslint-plugin-react": "^7.37.5",
7778
"eslint-plugin-react-compiler": "^19.1.0-rc.2",
7879
"eslint-plugin-react-hooks": "^5.2.0",
79-
"eslint-plugin-react-hooks-extra": "^1.52.6",
8080
"eslint-plugin-sonarjs": "^3.0.5",
81-
"eslint-plugin-testing-library": "^7.6.6",
81+
"eslint-plugin-testing-library": "^7.10.0",
8282
"jspdf": "^3.0.1",
8383
"jspdf-autotable": "^5.0.2",
8484
"playwright": "^1.54.2",

0 commit comments

Comments
 (0)