|
1 | 1 | module.exports = {
|
2 |
| - // Airbnb is the base, prettier is here so that eslint doesn't conflict with prettier |
3 |
| - extends: ['airbnb', 'prettier', 'prettier/react'], |
4 |
| - parser: '@typescript-eslint/parser', |
5 |
| - plugins: ['react', 'react-native', 'import', '@typescript-eslint'], |
6 |
| - rules: { |
7 |
| - 'no-console': 'off', |
8 |
| - // Lines will be broken before binary operators |
9 |
| - 'operator-linebreak': ['error', 'before'], |
10 |
| - // Allow imports from dev and peer dependencies |
11 |
| - 'import/no-extraneous-dependencies': [ |
12 |
| - 'error', |
13 |
| - { devDependencies: true, peerDependencies: true }, |
14 |
| - ], |
15 |
| - 'react/jsx-filename-extension': ['error', { extensions: ['.tsx'] }], |
16 |
| - // This rule doesn't play nice with Prettier |
17 |
| - 'react/jsx-one-expression-per-line': 'off', |
18 |
| - // This rule doesn't play nice with Prettier |
19 |
| - 'react/jsx-wrap-multilines': 'off', |
20 |
| - // Remove this rule because we only destructure props, but never state |
21 |
| - 'react/destructuring-assignment': 'off', |
22 |
| - 'react/prop-types': 'off', |
23 |
| - '@typescript-eslint/adjacent-overload-signatures': 'error', |
24 |
| - '@typescript-eslint/array-type': ['error', {default: 'array'}], |
25 |
| - '@typescript-eslint/consistent-type-assertions': 'error', |
26 |
| - '@typescript-eslint/generic-type-naming': ['error', '^[a-zA-Z]+$'], |
27 |
| - '@typescript-eslint/no-array-constructor': 'error', |
28 |
| - '@typescript-eslint/no-empty-interface': 'error', |
29 |
| - '@typescript-eslint/no-explicit-any': 'error', |
30 |
| - '@typescript-eslint/no-extraneous-class': 'error', |
31 |
| - '@typescript-eslint/no-inferrable-types': 'error', |
32 |
| - '@typescript-eslint/no-misused-new': 'error', |
33 |
| - '@typescript-eslint/no-namespace': 'error', |
34 |
| - '@typescript-eslint/no-non-null-assertion': 'error', |
35 |
| - '@typescript-eslint/no-parameter-properties': 'error', |
36 |
| - '@typescript-eslint/no-this-alias': 'error', |
37 |
| - '@typescript-eslint/no-type-alias': [ |
38 |
| - 'error', |
39 |
| - { |
40 |
| - allowAliases: 'always', |
41 |
| - allowCallbacks: 'always', |
42 |
| - allowMappedTypes: 'always', |
43 |
| - }, |
44 |
| - ], |
45 |
| - '@typescript-eslint/no-unused-vars': [ |
46 |
| - 'error', |
47 |
| - { ignoreRestSiblings: true }, |
48 |
| - ], |
49 |
| - '@typescript-eslint/prefer-namespace-keyword': 'error', |
50 |
| - '@typescript-eslint/type-annotation-spacing': 'error', |
51 |
| - }, |
52 |
| - settings: { |
53 |
| - 'import/resolver': { |
54 |
| - node: { |
55 |
| - extensions: [ |
56 |
| - '.js', |
57 |
| - '.android.js', |
58 |
| - '.ios.js', |
59 |
| - '.jsx', |
60 |
| - '.android.jsx', |
61 |
| - '.ios.jsx', |
62 |
| - '.tsx', |
63 |
| - '.ts', |
64 |
| - '.android.tsx', |
65 |
| - '.android.ts', |
66 |
| - '.ios.tsx', |
67 |
| - '.ios.ts', |
68 |
| - ], |
69 |
| - }, |
| 2 | + root: true, |
| 3 | + // Airbnb is the base, prettier is here so that eslint doesn't conflict with prettier |
| 4 | + extends: ['airbnb', 'prettier', 'prettier/react'], |
| 5 | + parser: '@typescript-eslint/parser', |
| 6 | + plugins: ['react', 'react-native', 'import', '@typescript-eslint'], |
| 7 | + rules: { |
| 8 | + 'no-console': 'off', |
| 9 | + 'no-else-return': 'off', |
| 10 | + // Lines will be broken before binary operators |
| 11 | + 'operator-linebreak': ['error', 'before'], |
| 12 | + // Allow imports from dev and peer dependencies |
| 13 | + 'import/no-extraneous-dependencies': [ |
| 14 | + 'error', |
| 15 | + { devDependencies: true, peerDependencies: true }, |
| 16 | + ], |
| 17 | + 'react/jsx-filename-extension': ['error', { extensions: ['.tsx', '.jsx'] }], |
| 18 | + // This rule doesn't play nice with Prettier |
| 19 | + 'react/jsx-one-expression-per-line': 'off', |
| 20 | + // This rule doesn't play nice with Prettier |
| 21 | + 'react/jsx-wrap-multilines': 'off', |
| 22 | + // Remove this rule because we only destructure props, but never state |
| 23 | + 'react/destructuring-assignment': 'off', |
| 24 | + 'react/prop-types': 'off', |
| 25 | + 'react/jsx-props-no-spreading': 'off', |
| 26 | + 'react/static-property-placement': 'off', |
| 27 | + 'react/state-in-constructor': 'off', |
| 28 | + '@typescript-eslint/adjacent-overload-signatures': 'error', |
| 29 | + '@typescript-eslint/array-type': [ |
| 30 | + 'error', |
| 31 | + { |
| 32 | + default: 'array', |
| 33 | + }, |
| 34 | + ], |
| 35 | + '@typescript-eslint/generic-type-naming': ['error', '^[a-zA-Z]+$'], |
| 36 | + '@typescript-eslint/no-array-constructor': 'error', |
| 37 | + '@typescript-eslint/no-empty-interface': 'error', |
| 38 | + '@typescript-eslint/no-explicit-any': 'error', |
| 39 | + '@typescript-eslint/no-extraneous-class': 'error', |
| 40 | + '@typescript-eslint/no-inferrable-types': 'error', |
| 41 | + '@typescript-eslint/no-misused-new': 'error', |
| 42 | + '@typescript-eslint/no-namespace': 'error', |
| 43 | + '@typescript-eslint/no-non-null-assertion': 'error', |
| 44 | + '@typescript-eslint/consistent-type-assertions': [ |
| 45 | + 'error', |
| 46 | + { |
| 47 | + assertionStyle: 'as', |
| 48 | + }, |
| 49 | + ], |
| 50 | + '@typescript-eslint/no-parameter-properties': 'error', |
| 51 | + '@typescript-eslint/no-this-alias': 'error', |
| 52 | + '@typescript-eslint/triple-slash-reference': [ |
| 53 | + 'error', |
| 54 | + { path: 'never', types: 'never', lib: 'never' }, |
| 55 | + ], |
| 56 | + '@typescript-eslint/no-type-alias': [ |
| 57 | + 'error', |
| 58 | + { |
| 59 | + allowAliases: 'always', |
| 60 | + allowCallbacks: 'always', |
| 61 | + allowMappedTypes: 'always', |
| 62 | + }, |
| 63 | + ], |
| 64 | + '@typescript-eslint/no-unused-vars': [ |
| 65 | + 'error', |
| 66 | + { ignoreRestSiblings: true }, |
| 67 | + ], |
| 68 | + '@typescript-eslint/consistent-type-definitions': [ |
| 69 | + 'error', |
| 70 | + 'interface', |
| 71 | + ], |
| 72 | + '@typescript-eslint/prefer-namespace-keyword': 'error', |
| 73 | + '@typescript-eslint/type-annotation-spacing': 'error', |
| 74 | + }, |
| 75 | + settings: { |
| 76 | + 'import/resolver': { |
| 77 | + node: { |
| 78 | + extensions: [ |
| 79 | + '.js', |
| 80 | + '.android.js', |
| 81 | + '.ios.js', |
| 82 | + '.jsx', |
| 83 | + '.android.jsx', |
| 84 | + '.ios.jsx', |
| 85 | + '.tsx', |
| 86 | + '.ts', |
| 87 | + '.android.tsx', |
| 88 | + '.android.ts', |
| 89 | + '.ios.tsx', |
| 90 | + '.ios.ts', |
| 91 | + ], |
70 | 92 | },
|
71 | 93 | },
|
72 |
| - }; |
| 94 | + }, |
| 95 | + globals: { |
| 96 | + fetch: false, |
| 97 | + HermesInternal: false, |
| 98 | + } |
| 99 | +}; |
0 commit comments