|
3 | 3 | // or overridden for a particular subset of the project. See |
4 | 4 | // other .eslintrc.js files for those rules. |
5 | 5 | module.exports = { |
6 | | - "globals": { |
7 | | - }, |
8 | | - "plugins": [ |
9 | | - "jsx-a11y", |
10 | | - "react-hooks" |
11 | | - ], |
12 | | - "extends": [ |
| 6 | + globals: {}, |
| 7 | + plugins: ['@typescript-eslint', 'jsx-a11y', 'react-hooks'], |
| 8 | + extends: [ |
13 | 9 | 'plugin:react/recommended', |
14 | | - "eslint:recommended", |
15 | | - "plugin:jsx-a11y/recommended", |
16 | | - "plugin:react-hooks/recommended" |
| 10 | + 'eslint:recommended', |
| 11 | + 'plugin:@typescript-eslint/recommended', |
| 12 | + 'plugin:jsx-a11y/recommended', |
| 13 | + 'plugin:react-hooks/recommended', |
17 | 14 | ], |
18 | | - "env": { |
19 | | - "browser": true, |
20 | | - "node": true, |
21 | | - "es6": true |
| 15 | + env: { |
| 16 | + browser: true, |
| 17 | + node: true, |
| 18 | + es6: true, |
| 19 | + }, |
| 20 | + settings: { |
| 21 | + react: { |
| 22 | + version: 'detect', |
| 23 | + }, |
22 | 24 | }, |
23 | | - "settings": { |
24 | | - "react": { |
25 | | - "version": "detect" |
26 | | - } |
| 25 | + parser: '@typescript-eslint/parser', |
| 26 | + parserOptions: { |
| 27 | + sourceType: 'module', |
| 28 | + ecmaFeatures: { |
| 29 | + jsx: true, |
| 30 | + }, |
27 | 31 | }, |
28 | | - "parser": "@babel/eslint-parser", |
29 | | - "parserOptions": { |
30 | | - "sourceType": "module", |
31 | | - "ecmaFeatures": { |
32 | | - "jsx": true |
33 | | - } |
| 32 | + rules: { |
| 33 | + 'array-bracket-spacing': ['error', 'never'], |
| 34 | + 'brace-style': ['error', '1tbs', {allowSingleLine: true}], |
| 35 | + 'comma-dangle': 'off', |
| 36 | + curly: 'error', |
| 37 | + 'dot-location': ['error', 'property'], |
| 38 | + 'eol-last': 'error', |
| 39 | + eqeqeq: 'error', |
| 40 | + 'jsx-quotes': 'error', |
| 41 | + 'keyword-spacing': 'error', |
| 42 | + 'no-array-constructor': 'off', |
| 43 | + '@typescript-eslint/no-array-constructor': 'error', |
| 44 | + 'no-console': 'off', |
| 45 | + 'no-duplicate-imports': 'error', |
| 46 | + 'no-empty': 'off', |
| 47 | + 'no-eval': 'error', |
| 48 | + 'no-ex-assign': 'off', |
| 49 | + 'no-extra-boolean-cast': 'off', |
| 50 | + 'no-implicit-globals': 'error', |
| 51 | + 'no-new-object': 'error', |
| 52 | + 'no-trailing-spaces': 'error', |
| 53 | + 'no-undef': 'off', |
| 54 | + 'no-unused-vars': 'off', |
| 55 | + '@typescript-eslint/no-unused-vars': ['error', {args: 'none'}], |
| 56 | + '@typescript-eslint/no-explicit-any': 'off', |
| 57 | + '@typescript-eslint/no-require-imports': 'off', |
| 58 | + 'no-useless-escape': 'off', |
| 59 | + 'no-with': 'error', |
| 60 | + 'object-curly-spacing': 'off', |
| 61 | + 'react/react-in-jsx-scope': 'off', |
| 62 | + 'react/button-has-type': 'error', |
| 63 | + 'react/display-name': 'off', |
| 64 | + 'react/jsx-closing-bracket-location': 'error', |
| 65 | + 'react/jsx-curly-spacing': 'error', |
| 66 | + 'react/jsx-first-prop-new-line': ['error', 'multiline'], |
| 67 | + 'react/jsx-indent-props': ['error', 2], |
| 68 | + 'react/jsx-key': 'off', |
| 69 | + 'react/jsx-no-target-blank': 'off', |
| 70 | + 'react/jsx-wrap-multilines': 'error', |
| 71 | + 'react/no-danger': 'error', |
| 72 | + 'react/no-find-dom-node': 'off', |
| 73 | + 'react/no-render-return-value': 'off', |
| 74 | + 'react/no-string-refs': 'off', |
| 75 | + 'react/no-unescaped-entities': 'off', |
| 76 | + 'react/prop-types': 'off', |
| 77 | + 'react/self-closing-comp': 'error', |
| 78 | + semi: 'off', |
| 79 | + 'space-before-blocks': 'error', |
| 80 | + strict: 'off', |
| 81 | + 'jsx-a11y/no-onchange': 0, |
34 | 82 | }, |
35 | | - "rules": { |
36 | | - "array-bracket-spacing": ["error", "never"], |
37 | | - "brace-style": ["error", "1tbs", { allowSingleLine: true }], |
38 | | - "comma-dangle": "off", |
39 | | - curly: "error", |
40 | | - "dot-location": ["error", "property"], |
41 | | - "eol-last": "error", |
42 | | - eqeqeq: "error", |
43 | | - "jsx-quotes": "error", // autofixable |
44 | | - "keyword-spacing": "error", |
45 | | - "no-array-constructor": "error", |
46 | | - "no-console": "off", |
47 | | - "no-duplicate-imports": "error", |
48 | | - "no-empty": "off", |
49 | | - "no-eval": "error", |
50 | | - "no-ex-assign": "off", |
51 | | - "no-extra-boolean-cast": "off", |
52 | | - "no-implicit-globals": "error", |
53 | | - "no-new-object": "error", |
54 | | - "no-trailing-spaces": "error", |
55 | | - "no-undef": "error", |
56 | | - "no-unused-vars": ["error", { args: "none" }], |
57 | | - "no-useless-escape": "off", |
58 | | - "no-with": "error", |
59 | | - "object-curly-spacing": "off", |
60 | | - "react/react-in-jsx-scope": "off", |
61 | | - "react/button-has-type": "error", |
62 | | - "react/display-name": "off", |
63 | | - "react/jsx-closing-bracket-location": "error", // autofixable |
64 | | - "react/jsx-curly-spacing": "error", // autofixable |
65 | | - "react/jsx-first-prop-new-line": ["error", "multiline"], |
66 | | - "react/jsx-indent-props": ["error", 2], // autofixable |
67 | | - "react/jsx-key": "off", |
68 | | - "react/jsx-no-target-blank": "off", |
69 | | - "react/jsx-wrap-multilines": "error", // autofixable |
70 | | - "react/no-danger": "error", |
71 | | - "react/no-find-dom-node": "off", |
72 | | - "react/no-render-return-value": "off", |
73 | | - "react/no-string-refs": "off", |
74 | | - "react/no-unescaped-entities": "off", |
75 | | - "react/self-closing-comp": "error", |
76 | | - semi: "off", // enforced by babel/semi |
77 | | - "space-before-blocks": "error", |
78 | | - strict: "error", |
79 | | - "jsx-a11y/no-onchange": 0 |
80 | | - |
81 | | - } |
82 | 83 | }; |
0 commit comments