|
1 | 1 | module.exports = {
|
2 |
| - root: true, |
3 |
| - env: { browser: true, es2020: true }, |
| 2 | + env: { |
| 3 | + browser: true, |
| 4 | + es2020: true, |
| 5 | + node: true, |
| 6 | + }, |
4 | 7 | extends: [
|
5 | 8 | 'eslint:recommended',
|
6 | 9 | 'plugin:@typescript-eslint/recommended',
|
7 | 10 | 'plugin:react-hooks/recommended',
|
| 11 | + 'plugin:prettier/recommended', |
| 12 | + 'plugin:import/typescript', |
| 13 | + 'plugin:import/recommended', |
8 | 14 | ],
|
9 |
| - ignorePatterns: ['dist', '.eslintrc.cjs'], |
10 | 15 | parser: '@typescript-eslint/parser',
|
11 |
| - plugins: ['react-refresh'], |
| 16 | + parserOptions: { |
| 17 | + ecmaVersion: 'latest', |
| 18 | + sourceType: 'module', |
| 19 | + }, |
| 20 | + plugins: ['react-refresh', 'prettier', 'import'], |
| 21 | + settings: { |
| 22 | + 'import/resolver': { |
| 23 | + node: {}, |
| 24 | + typescript: { |
| 25 | + directory: './src', |
| 26 | + }, |
| 27 | + }, |
| 28 | + 'import/parsers': { |
| 29 | + '@typescript-eslint/parser': ['.ts', '.tsx'], |
| 30 | + }, |
| 31 | + }, |
12 | 32 | rules: {
|
13 |
| - 'react-refresh/only-export-components': [ |
14 |
| - 'warn', |
15 |
| - { allowConstantExport: true }, |
| 33 | + 'react-refresh/only-export-components': 'warn', |
| 34 | + 'import/order': [ |
| 35 | + 'error', |
| 36 | + { |
| 37 | + groups: ['builtin', 'external', 'parent', 'sibling', 'index'], |
| 38 | + alphabetize: { |
| 39 | + order: 'asc', |
| 40 | + caseInsensitive: true, |
| 41 | + }, |
| 42 | + 'newlines-between': 'never', |
| 43 | + }, |
16 | 44 | ],
|
| 45 | + 'import/no-unresolved': 'off', |
| 46 | + 'import/export': 'off', |
| 47 | + 'import/named': 0, |
| 48 | + 'import/no-named-as-default': 0, |
17 | 49 | },
|
18 |
| -} |
| 50 | +}; |
0 commit comments