1
1
import js from "@eslint/js"
2
2
import react from "eslint-plugin-react"
3
+ import hooks from "eslint-plugin-react-hooks"
3
4
import simpleImportSort from "eslint-plugin-simple-import-sort"
4
5
import globals from "globals"
5
6
import tseslint from "typescript-eslint"
@@ -15,10 +16,15 @@ export default [
15
16
...tseslint . configs . recommended ,
16
17
{
17
18
plugins : {
19
+ // https://github.com/lydell/eslint-plugin-simple-import-sort
18
20
"simple-import-sort" : simpleImportSort ,
21
+ // https://typescript-eslint.io/getting-started/
19
22
"@typescript-eslint" : tseslint . plugin ,
20
- // ref https://github.com/jsx-eslint/eslint-plugin-react
23
+ // https://github.com/jsx-eslint/eslint-plugin-react
21
24
react,
25
+ // https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks
26
+ // compat with ESLint v9, see https://github.com/facebook/react/issues/28313
27
+ "react-hooks" : hooks ,
22
28
} ,
23
29
languageOptions : {
24
30
parser : tseslint . parser ,
@@ -69,6 +75,9 @@ export default [
69
75
// ref https://github.com/lydell/eslint-plugin-simple-import-sort#usage
70
76
"simple-import-sort/imports" : "error" ,
71
77
"simple-import-sort/exports" : "error" ,
78
+
79
+ // as hooks plugin does not play well with Flat Config right now, do this
80
+ ...hooks . configs . recommended . rules ,
72
81
} ,
73
82
} ,
74
83
{
0 commit comments