|
1 | 1 | module.exports = { |
2 | 2 | env: { |
3 | 3 | browser: true, |
4 | | - es6: true, |
| 4 | + es2020: true, |
5 | 5 | }, |
6 | 6 | extends: [ |
7 | 7 | 'plugin:react/recommended', |
8 | 8 | 'airbnb', |
| 9 | + 'plugin:@typescript-eslint/recommended', |
| 10 | + 'prettier/@typescript-eslint', |
| 11 | + 'plugin:prettier/recommended', |
9 | 12 | ], |
10 | | - globals: { |
11 | | - Atomics: 'readonly', |
12 | | - SharedArrayBuffer: 'readonly', |
13 | | - }, |
14 | 13 | parser: '@typescript-eslint/parser', |
15 | 14 | parserOptions: { |
16 | 15 | ecmaFeatures: { |
17 | 16 | jsx: true, |
18 | 17 | }, |
19 | | - ecmaVersion: 2018, |
| 18 | + ecmaVersion: 11, |
20 | 19 | sourceType: 'module', |
21 | 20 | }, |
22 | | - plugins: [ |
23 | | - 'react', |
24 | | - '@typescript-eslint', |
25 | | - ], |
| 21 | + plugins: ['react', 'react-hooks', '@typescript-eslint', 'prettier'], |
26 | 22 | rules: { |
| 23 | + 'prettier/prettier': 'error', |
| 24 | + 'react-hooks/rules-of-hooks': 'error', |
| 25 | + 'react-hooks/exhaustive-deps': 'warn', |
| 26 | + 'react/jsx-filename-extension': [1, { extensions: ['.tsx'] }], |
| 27 | + 'import/prefer-default-export': 'off', |
| 28 | + 'react/jsx-one-expression-per-line': 'off', |
| 29 | + 'react/jsx-props-no-spreading': 'off', |
| 30 | + 'no-unused-expressions': 'off', |
| 31 | + 'react/prop-types': 'off', |
| 32 | + 'import/no-duplicates': 'off', |
| 33 | + '@typescript-eslint/explicit-function-return-type': [ |
| 34 | + 'error', |
| 35 | + { |
| 36 | + allowExpressions: true, |
| 37 | + }, |
| 38 | + ], |
| 39 | + '@typescript-eslint/camelcase': 'off', |
| 40 | + 'import/extensions': [ |
| 41 | + 'error', |
| 42 | + 'ignorePackages', |
| 43 | + { |
| 44 | + ts: 'never', |
| 45 | + tsx: 'never', |
| 46 | + }, |
| 47 | + ], |
| 48 | + }, |
| 49 | + settings: { |
| 50 | + 'import/resolver': { |
| 51 | + typescript: {}, |
| 52 | + }, |
27 | 53 | }, |
28 | 54 | }; |
0 commit comments