|
1 | 1 | module.exports = { |
2 | | - env: { |
3 | | - es6: true, |
4 | | - node: true, |
5 | | - jest: true, |
6 | | - }, |
7 | | - extends: [ |
8 | | - 'plugin:@typescript-eslint/recommended', |
9 | | - 'prettier', |
10 | | - 'plugin:prettier/recommended', |
11 | | - 'prettier/react', |
12 | | - 'prettier/@typescript-eslint', |
13 | | - ], |
14 | | - |
15 | | - parser: '@typescript-eslint/parser', |
16 | | - parserOptions: { |
17 | | - createDefaultProgram: true, |
18 | | - ecmaFeatures: { |
19 | | - jsx: true, |
20 | | - impliedStrict: true, |
21 | | - }, |
22 | | - ecmaVersion: 2018, |
23 | | - sourceType: 'module', |
24 | | - project: './tsconfig.json', |
25 | | - }, |
26 | | - // plugins: ['react', 'react-native'], |
27 | | - |
28 | | - plugins: ['react', 'react-hooks', 'react-native', 'prettier'], |
29 | | - |
| 2 | + root: true, |
| 3 | + extends: '@react-native-community', |
| 4 | + plugins: ['react-hooks'], |
30 | 5 | rules: { |
31 | | - indent: ['error', 2, { SwitchCase: 1 }], |
32 | | - quotes: ['error', 'single', { avoidEscape: true }], |
33 | | - '@typescript-eslint/no-var-requires': 0, |
34 | | - 'react-native/no-unused-styles': 2, |
35 | | - 'react-native/split-platform-components': 2, |
36 | | - 'react-native/no-inline-styles': 2, |
37 | | - 'react-native/no-color-literals': 2, |
38 | | - 'react-native/no-single-element-style-arrays': 2, |
39 | | - 'global-require': 0, |
40 | | - 'linebreak-style': [2, 'unix'], |
41 | | - 'prefer-const': 0, |
42 | | - 'no-console': [ |
43 | | - 'warn', |
| 6 | + semi: ['error', 'never'], |
| 7 | + quotes: ['error', 'single'], |
| 8 | + radix: 0, |
| 9 | + 'max-len': [ |
| 10 | + 'error', |
44 | 11 | { |
45 | | - allow: ['warn', 'error', 'log', 'info', 'disableYellowBox'], |
46 | | - }, |
| 12 | + code: 120, |
| 13 | + tabWidth: 2, |
| 14 | + comments: 100, |
| 15 | + ignoreUrls: true, |
| 16 | + ignoreRegExpLiterals: true, |
| 17 | + ignorePattern: '^import\\W.*' |
| 18 | + } |
47 | 19 | ], |
48 | | - 'no-param-reassign': 0, |
49 | | - '@typescript-eslint/explicit-module-boundary-types': 'off', |
50 | | - 'no-restricted-globals': 0, |
51 | | - 'no-unused-vars': 0, |
52 | | - 'no-use-before-define': 0, |
53 | | - 'no-underscore-dangle': 0, |
54 | | - 'no-useless-constructor': 0, |
55 | | - 'no-unused-expressions': 0, |
56 | | - 'no-plusplus': 0, |
57 | | - 'no-nested-ternary': 0, |
58 | | - 'lines-between-class-members': [ |
59 | | - 1, |
60 | | - 'always', |
61 | | - { |
62 | | - exceptAfterSingleLine: true, |
63 | | - }, |
64 | | - ], |
65 | | - 'prefer-destructuring': [ |
66 | | - 2, |
67 | | - { |
68 | | - array: false, |
69 | | - object: true, |
70 | | - }, |
71 | | - ], |
72 | | - 'max-classes-per-file': 0, |
73 | | - 'import/prefer-default-export': 0, |
74 | | - 'react/prefer-stateless-function': 0, |
75 | | - 'react/destructuring-assignment': 0, |
76 | | - 'react/prop-types': 0, |
77 | | - 'react/react-in-jsx-scope': 0, |
78 | | - 'react/jsx-props-no-spreading': 0, |
79 | | - 'react/jsx-filename-extension': [ |
80 | | - 2, |
81 | | - { |
82 | | - extensions: ['.jsx', '.tsx'], |
83 | | - }, |
84 | | - ], |
85 | | - 'jsx-a11y/accessible-emoji': 0, |
86 | | - 'react/static-property-placement': 0, |
87 | | - '@typescript-eslint/explicit-member-accessibility': [2, { accessibility: 'no-public' }], |
88 | | - '@typescript-eslint/no-empty-interface': 1, |
89 | | - '@typescript-eslint/explicit-function-return-type': [ |
90 | | - 0, |
91 | | - { |
92 | | - allowExpressions: true, |
93 | | - allowTypedFunctionExpressions: true, |
94 | | - }, |
95 | | - ], |
96 | | - '@typescript-eslint/no-explicit-any': 0, |
97 | | - '@typescript-eslint/no-use-before-define': [ |
98 | | - 2, |
99 | | - { |
100 | | - functions: true, |
101 | | - classes: true, |
102 | | - variables: false, |
103 | | - }, |
104 | | - ], |
105 | | - '@typescript-eslint/no-unused-vars': [1, { args: 'none' }], |
106 | | - '@typescript-eslint/no-non-null-assertion': 0, |
107 | | - '@typescript-eslint/camelcase': 0, |
108 | | - '@typescript-eslint/ban-ts-ignore': 0, |
109 | | - '@typescript-eslint/no-empty-function': 'off', |
110 | | - }, |
111 | | - settings: { |
112 | | - react: { |
113 | | - version: 'detect', |
114 | | - }, |
115 | | - }, |
116 | | -}; |
| 20 | + curly: 'error', |
| 21 | + 'arrow-parens': ['error', 'always'], |
| 22 | + 'arrow-spacing': 'error', |
| 23 | + 'comma-dangle': ['error', 'never'], |
| 24 | + 'react/self-closing-comp': ['error'], |
| 25 | + 'no-mixed-spaces-and-tabs': 0, |
| 26 | + 'no-shadow': 0, |
| 27 | + 'no-unused-vars': ['error', { vars: 'local', args: 'after-used' }], |
| 28 | + 'no-duplicate-imports': 'error', |
| 29 | + 'no-var': 'error', |
| 30 | + 'no-const-assign': 'error', |
| 31 | + 'no-dupe-args': 'error', |
| 32 | + 'no-dupe-keys': 'error', |
| 33 | + 'no-duplicate-case': 'error', |
| 34 | + 'no-empty': 'error', |
| 35 | + 'no-sparse-arrays': 'error', |
| 36 | + 'no-multi-spaces': 'error', |
| 37 | + 'no-useless-escape': 'error', |
| 38 | + 'no-extra-boolean-cast': 'error', |
| 39 | + 'no-alert': 'error', |
| 40 | + 'block-scoped-var': 'error', |
| 41 | + 'dot-notation': 0, |
| 42 | + 'array-bracket-spacing': ['error', 'never'], |
| 43 | + 'prefer-arrow-callback': 'error', |
| 44 | + 'template-curly-spacing': 'error', |
| 45 | + 'default-case': 'error', |
| 46 | + 'block-spacing': 'error', |
| 47 | + 'brace-style': ['error', '1tbs', { allowSingleLine: true }], |
| 48 | + 'comma-style': 'error', |
| 49 | + 'computed-property-spacing': 'error', |
| 50 | + 'eol-last': 'error', |
| 51 | + 'func-call-spacing': ['error', 'never'], |
| 52 | + 'func-style': ['off', 'expression', { allowArrowFunctions: true }], |
| 53 | + 'key-spacing': ['error', { beforeColon: false }], |
| 54 | + 'keyword-spacing': ['error', { before: true }], |
| 55 | + 'jsx-quotes': ['error', 'prefer-single'], |
| 56 | + 'react-hooks/rules-of-hooks': 'error', |
| 57 | + 'react-hooks/exhaustive-deps': 'warn', |
| 58 | + 'react-native/no-inline-styles': 'error' |
| 59 | + } |
| 60 | +} |
0 commit comments