|
1 | 1 | {
|
| 2 | + "root": true, |
2 | 3 | "env": {
|
3 |
| - "commonjs": true, |
4 |
| - "es2021": true, |
| 4 | + "browser": true, |
| 5 | + "es2022": true, |
5 | 6 | "node": true
|
6 | 7 | },
|
7 | 8 | "extends": [
|
8 | 9 | "eslint:recommended",
|
9 |
| - "plugin:react/recommended", |
10 | 10 | "plugin:@typescript-eslint/recommended",
|
11 |
| - "plugin:import/recommended", |
12 |
| - "plugin:import/typescript" |
| 11 | + "plugin:@typescript-eslint/recommended-requiring-type-checking", |
| 12 | + "plugin:react/recommended", |
| 13 | + "plugin:react-hooks/recommended", |
| 14 | + "prettier" |
13 | 15 | ],
|
14 | 16 | "parser": "@typescript-eslint/parser",
|
15 | 17 | "parserOptions": {
|
16 | 18 | "ecmaVersion": "latest",
|
17 | 19 | "sourceType": "module",
|
| 20 | + "project": "./tsconfig.json", |
18 | 21 | "ecmaFeatures": {
|
19 | 22 | "jsx": true
|
20 | 23 | }
|
21 | 24 | },
|
22 |
| - "plugins": ["react", "@typescript-eslint", "react-hooks", "import"], |
23 |
| - "rules": { |
24 |
| - "no-empty": "off", |
25 |
| - "indent": ["warn", "tab"], |
26 |
| - "linebreak-style": ["error", "unix"], |
27 |
| - "quotes": ["error", "backtick"], |
28 |
| - "semi": ["error", "always"], |
29 |
| - "no-unused-vars": "warn", |
30 |
| - "react/react-in-jsx-scope": "off", |
31 |
| - "react-hooks/rules-of-hooks": "error", |
32 |
| - "react-hooks/exhaustive-deps": "warn", |
33 |
| - "import/extensions": ["error", "always", { |
34 |
| - "js": "always", |
35 |
| - "jsx": "always", |
36 |
| - "ts": "always", |
37 |
| - "tsx": "always" |
38 |
| - }] |
39 |
| - }, |
| 25 | + "plugins": ["@typescript-eslint", "react", "react-hooks"], |
40 | 26 | "settings": {
|
41 | 27 | "react": {
|
42 | 28 | "version": "detect"
|
43 | 29 | },
|
44 | 30 | "import/resolver": {
|
45 | 31 | "typescript": {
|
46 |
| - "alwaysTryTypes": true |
| 32 | + "alwaysTryTypes": true, |
| 33 | + "project": "./tsconfig.json" |
47 | 34 | }
|
48 | 35 | }
|
| 36 | + }, |
| 37 | + "rules": { |
| 38 | + // TypeScript specific rules |
| 39 | + "@typescript-eslint/explicit-function-return-type": "off", |
| 40 | + "@typescript-eslint/explicit-module-boundary-types": "off", |
| 41 | + "@typescript-eslint/no-explicit-any": "warn", |
| 42 | + "@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }], |
| 43 | + "@typescript-eslint/no-non-null-assertion": "warn", |
| 44 | + |
| 45 | + // React specific rules |
| 46 | + "react/react-in-jsx-scope": "off", |
| 47 | + "react/prop-types": "off", |
| 48 | + "react-hooks/rules-of-hooks": "error", |
| 49 | + "react-hooks/exhaustive-deps": "warn", |
| 50 | + |
| 51 | + // General rules |
| 52 | + "no-console": ["warn", { "allow": ["warn", "error"] }], |
| 53 | + "no-debugger": "warn", |
| 54 | + "no-unused-vars": "off" // Turned off in favor of @typescript-eslint/no-unused-vars |
49 | 55 | }
|
50 | 56 | }
|
0 commit comments