|
1 | 1 | { |
| 2 | + "root": true, |
2 | 3 | "parser": "@typescript-eslint/parser", |
3 | 4 | "env": { |
4 | | - "node": true, |
5 | 5 | "browser": true, |
6 | | - "es6": true, |
7 | | - "commonjs": true |
| 6 | + "es2020": true |
8 | 7 | }, |
9 | 8 | "plugins": [ |
10 | 9 | "@typescript-eslint", |
11 | 10 | "import", |
| 11 | + "react", |
| 12 | + "react-hooks", |
12 | 13 | "prettier", |
13 | 14 | "formatjs" |
14 | 15 | ], |
15 | 16 | "extends": [ |
| 17 | + "eslint:recommended", |
16 | 18 | "plugin:@typescript-eslint/recommended", |
17 | | - "plugin:prettier/recommended", |
| 19 | + "plugin:react/recommended", |
| 20 | + "plugin:react/jsx-runtime", |
18 | 21 | "plugin:import/recommended", |
19 | 22 | "plugin:import/typescript", |
20 | | - "plugin:jest/recommended" |
| 23 | + "plugin:prettier/recommended" |
21 | 24 | ], |
22 | | - "parserOptions": { |
23 | | - "sourceType": "module", |
24 | | - "ecmaVersion": 2018 |
| 25 | + "settings": { |
| 26 | + "react": { |
| 27 | + "version": "detect" |
| 28 | + } |
25 | 29 | }, |
26 | 30 | "rules": { |
| 31 | + "react-hooks/rules-of-hooks": "error", |
| 32 | + "react-hooks/exhaustive-deps": "warn", |
27 | 33 | "@typescript-eslint/no-unused-vars": "error", |
28 | 34 | "@typescript-eslint/member-delimiter-style": "off", |
29 | 35 | "@typescript-eslint/explicit-function-return-type": "off", |
30 | | - "formatjs/enforce-default-message": ["error", "literal"], |
31 | | - "formatjs/enforce-placeholders": "error", |
32 | | - "formatjs/no-multiple-whitespaces": "error", |
33 | | - "formatjs/enforce-id": "error", |
34 | 36 | "import/order": [ |
35 | 37 | "error", |
36 | 38 | { |
37 | | - "groups": ["builtin", "external", "unknown", "parent", "sibling", "index"] |
| 39 | + "groups": [ |
| 40 | + "builtin", |
| 41 | + "external", |
| 42 | + "unknown", |
| 43 | + "parent", |
| 44 | + "sibling", |
| 45 | + "index" |
| 46 | + ] |
| 47 | + } |
| 48 | + ], |
| 49 | + "formatjs/enforce-default-message": ["error", "literal"], |
| 50 | + "formatjs/enforce-placeholders": "error", |
| 51 | + "formatjs/no-multiple-whitespaces": "error", |
| 52 | + "formatjs/enforce-id": "error" |
| 53 | + }, |
| 54 | + "overrides": [ |
| 55 | + { |
| 56 | + "files": ["*.js"], |
| 57 | + "env": { |
| 58 | + "node": true |
38 | 59 | } |
39 | | - ] |
40 | | - } |
| 60 | + }, |
| 61 | + { |
| 62 | + "files": ["*.test.ts", "*.test.tsx"], |
| 63 | + "env": { |
| 64 | + "jest": true |
| 65 | + }, |
| 66 | + "extends": ["plugin:jest/recommended"] |
| 67 | + } |
| 68 | + ] |
41 | 69 | } |
0 commit comments