|
1 | 1 | module.exports = {
|
2 | 2 | root: true,
|
3 |
| - extends: ['@react-native', 'plugin:prettier/recommended', 'prettier'], |
4 |
| - plugins: ['react', 'unused-imports', 'prettier'], |
| 3 | + extends: ['plugin:prettier/recommended', '@react-native'], |
| 4 | + parser: '@typescript-eslint/parser', |
| 5 | + plugins: ['react-native', 'prettier', '@typescript-eslint', 'unused-imports', 'simple-import-sort', 'import'], |
| 6 | + env: { |
| 7 | + 'react-native/react-native': true, |
| 8 | + }, |
5 | 9 | parserOptions: {
|
6 | 10 | ecmaFeatures: {
|
7 |
| - jsx: true |
| 11 | + jsx: true, |
8 | 12 | },
|
9 |
| - requireConfigFile: false |
| 13 | + }, |
| 14 | + settings: { |
| 15 | + 'react-native/style-sheet-object-names': ['ScaledSheet'], |
10 | 16 | },
|
11 | 17 | rules: {
|
| 18 | + 'react-native/no-unused-styles': 2, |
12 | 19 | '@typescript-eslint/no-unused-vars': 'off', // or "no-unused-vars": "off",
|
13 | 20 | 'unused-imports/no-unused-imports': 'error',
|
14 |
| - 'unused-imports/no-unused-vars': [ |
15 |
| - 'warn', |
16 |
| - { |
17 |
| - vars: 'all', |
18 |
| - varsIgnorePattern: '^_', |
19 |
| - args: 'after-used', |
20 |
| - argsIgnorePattern: '^_' |
21 |
| - } |
22 |
| - ], |
| 21 | + 'unused-imports/no-unused-vars': 0, |
| 22 | + semi: ['warn', 'never'], |
23 | 23 | 'prettier/prettier': [
|
24 | 24 | 'error',
|
25 | 25 | {
|
26 |
| - printWidth: 110, |
| 26 | + singleQuote: true, |
| 27 | + semi: false, |
27 | 28 | arrowParens: 'avoid',
|
28 | 29 | bracketSameLine: true,
|
29 | 30 | bracketSpacing: true,
|
30 |
| - singleQuote: true, |
31 |
| - trailingComma: 'none', |
32 |
| - tabWidth: 2, |
33 |
| - useTabs: false, |
34 |
| - semi: false |
35 |
| - } |
| 31 | + trailingComma: 'all', |
| 32 | + printWidth: 120, |
| 33 | + }, |
36 | 34 | ],
|
37 |
| - semi: 'off', |
38 |
| - 'comma-dangle': ['warn', 'never'], |
39 |
| - 'react-native/no-inline-styles': 'off', |
40 |
| - 'react-hooks/exhaustive-deps': 'off' |
41 |
| - } |
| 35 | + 'comma-dangle': 0, |
| 36 | + 'simple-import-sort/imports': 'off', |
| 37 | + 'simple-import-sort/exports': 'error', |
| 38 | + 'import/order': [ |
| 39 | + 'error', |
| 40 | + { |
| 41 | + pathGroups: [ |
| 42 | + { |
| 43 | + pattern: 'react', |
| 44 | + group: 'builtin', |
| 45 | + position: 'before', |
| 46 | + }, |
| 47 | + ], |
| 48 | + pathGroupsExcludedImportTypes: ['react'], |
| 49 | + }, |
| 50 | + ], |
| 51 | + 'import/first': 'error', |
| 52 | + 'import/newline-after-import': 'off', |
| 53 | + 'import/no-duplicates': 'error', |
| 54 | + 'react/display-name': 'off', |
| 55 | + '@typescript-eslint/consistent-type-imports': 'error', |
| 56 | + }, |
| 57 | + overrides: [ |
| 58 | + { |
| 59 | + files: ['*.ts', '*.tsx'], |
| 60 | + rules: { |
| 61 | + '@typescript-eslint/no-shadow': ['error'], |
| 62 | + 'no-shadow': 'off', |
| 63 | + 'no-undef': 'off', |
| 64 | + 'react-hooks/exhaustive-deps': 'warn', |
| 65 | + 'react-native/no-unused-styles': 'warn', |
| 66 | + }, |
| 67 | + }, |
| 68 | + ], |
42 | 69 | }
|
0 commit comments