|
9 | 9 | "eslint:recommended", |
10 | 10 | "plugin:react/recommended", |
11 | 11 | "plugin:react-hooks/recommended", |
| 12 | + "plugin:import/recommended", |
12 | 13 | "plugin:prettier/recommended" |
13 | 14 | ], |
14 | 15 | "parserOptions": { |
|
21 | 22 | "settings": { |
22 | 23 | "react": { |
23 | 24 | "version": "detect" |
| 25 | + }, |
| 26 | + "import/resolver": { |
| 27 | + "node": { |
| 28 | + "extensions": [".js", ".jsx"] |
| 29 | + } |
24 | 30 | } |
25 | 31 | }, |
26 | | - "plugins": ["react", "react-hooks"], |
| 32 | + "plugins": ["react", "react-hooks", "react-refresh", "import"], |
27 | 33 | "rules": { |
28 | | - "no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }], |
| 34 | + "no-unused-vars": [ |
| 35 | + "warn", |
| 36 | + { "argsIgnorePattern": "^_", "ignoreRestSiblings": true } |
| 37 | + ], |
29 | 38 | "no-console": "off", |
| 39 | + |
| 40 | + "eqeqeq": ["error", "always"], |
| 41 | + "no-var": "error", |
| 42 | + "prefer-const": ["warn", { "destructuring": "all" }], |
| 43 | + "no-implicit-coercion": "warn", |
| 44 | + |
30 | 45 | "quotes": ["error", "double", { "allowTemplateLiterals": true }], |
31 | 46 | "semi": ["error", "always"], |
| 47 | + |
32 | 48 | "react/react-in-jsx-scope": "off", |
33 | 49 | "react/prop-types": "off", |
| 50 | + "react/jsx-uses-react": "off", |
| 51 | + "react/jsx-uses-vars": "error", |
| 52 | + |
| 53 | + "react-hooks/rules-of-hooks": "error", |
| 54 | + "react-hooks/exhaustive-deps": "warn", |
| 55 | + |
| 56 | + "react-refresh/only-export-components": [ |
| 57 | + "warn", |
| 58 | + { "allowConstantExport": true } |
| 59 | + ], |
| 60 | + |
34 | 61 | "prettier/prettier": [ |
35 | 62 | "warn", |
36 | 63 | { |
37 | 64 | "endOfLine": "auto" |
38 | 65 | } |
| 66 | + ], |
| 67 | + |
| 68 | + "import/order": [ |
| 69 | + "warn", |
| 70 | + { |
| 71 | + "groups": [ |
| 72 | + "builtin", |
| 73 | + "external", |
| 74 | + "internal", |
| 75 | + ["parent", "sibling"], |
| 76 | + "index" |
| 77 | + ], |
| 78 | + "newlines-between": "always" |
| 79 | + } |
| 80 | + ], |
| 81 | + |
| 82 | + "import/no-duplicates": "warn", |
| 83 | + "import/no-unresolved": [ |
| 84 | + "error", |
| 85 | + { |
| 86 | + "ignore": [ |
| 87 | + "\\.css$", |
| 88 | + "\\.scss$", |
| 89 | + "\\.sass$", |
| 90 | + "\\.svg$", |
| 91 | + "\\.png$", |
| 92 | + "\\.jpg$", |
| 93 | + "\\.jpeg$", |
| 94 | + "\\.gif$" |
| 95 | + ] |
| 96 | + } |
39 | 97 | ] |
40 | 98 | } |
41 | 99 | } |
0 commit comments