Skip to content

Commit 86ff8e7

Browse files
committed
Add eslint-plugin-react configuration and rules
- Just default recommended rules for now
1 parent bafeea9 commit 86ff8e7

File tree

3 files changed

+2503
-20
lines changed

3 files changed

+2503
-20
lines changed

eslint.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import js from "@eslint/js";
22
import globals from "globals";
3+
import react from "eslint-plugin-react";
34
import reactHooks from "eslint-plugin-react-hooks";
45
import reactRefresh from "eslint-plugin-react-refresh";
56
import tseslint from "typescript-eslint";
@@ -17,15 +18,20 @@ export default tseslint.config(
1718
ecmaVersion: 2020,
1819
globals: globals.browser,
1920
parserOptions: {
21+
...react.configs.flat.recommended.languageOptions,
2022
project: ["./tsconfig.node.json", "./tsconfig.app.json"],
2123
tsconfigRootDir: import.meta.dirname,
2224
},
2325
},
26+
settings: { react: { version: "detect" } },
2427
plugins: {
28+
react,
2529
"react-hooks": reactHooks,
2630
"react-refresh": reactRefresh,
2731
},
2832
rules: {
33+
...react.configs.recommended.rules,
34+
...react.configs["jsx-runtime"].rules,
2935
...reactHooks.configs.recommended.rules,
3036
"@typescript-eslint/dot-notation": ["error", { allowIndexSignaturePropertyAccess: true }],
3137
"@typescript-eslint/no-confusing-void-expression": ["error", { ignoreArrowShorthand: true }],

0 commit comments

Comments
 (0)