|
7 | 7 | "version": "detect" |
8 | 8 | } |
9 | 9 | }, |
10 | | - "extends": ["plugin:react/recommended", "prettier", "eslint:recommended", "plugin:@typescript-eslint/recommended"], |
11 | 10 | "parserOptions": { |
12 | 11 | "ecmaFeatures": { |
13 | 12 | "jsx": true |
|
16 | 15 | "sourceType": "module", |
17 | 16 | "project": ["**/tsconfig.json"] |
18 | 17 | }, |
| 18 | + "overrides": [ |
| 19 | + { |
| 20 | + "files": ["__tests__/**/*"], |
| 21 | + "env": { |
| 22 | + "jest": true |
| 23 | + } |
| 24 | + } |
| 25 | + ], |
19 | 26 | "parser": "@typescript-eslint/parser", |
20 | 27 | "plugins": ["react", "react-native", "@typescript-eslint"], |
21 | 28 | "root": true, |
| 29 | + "extends": ["airbnb/legacy"], |
22 | 30 | "rules": { |
23 | | - //JavaScript rules |
24 | | - "prefer-template": "error", |
25 | | - // allow .js files to contain JSX code |
26 | | - "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx", ".tsx"] }], |
27 | | - |
28 | | - // prevent eslint to complain about the "styles" variable being used before it was defined |
29 | | - "no-use-before-define": ["error", { "variables": false }], |
30 | | - |
31 | | - // ignore errors for the react-navigation package |
32 | | - "react/prop-types": ["error", { "ignore": ["navigation", "navigation.navigate"] }], |
33 | | - "no-var": "warn", |
34 | | - "curly": ["error", "all"], |
35 | | - |
36 | | - //TypeScript related rules |
37 | | - "@typescript-eslint/adjacent-overload-signatures": "error", |
38 | | - "@typescript-eslint/array-type": "warn", |
39 | | - "@typescript-eslint/await-thenable": "error", |
40 | | - "@typescript-eslint/ban-ts-comment": "error", //??? |
41 | | - "@typescript-eslint/ban-types": "error", |
42 | | - "@typescript-eslint/class-literal-property-style": "warn", |
43 | | - "@typescript-eslint/consistent-generic-constructors": "warn", |
44 | | - "@typescript-eslint/consistent-indexed-object-style": "warn", |
45 | | - "@typescript-eslint/consistent-type-assertions": "warn", |
46 | | - "@typescript-eslint/consistent-type-definitions": "warn", |
47 | | - "@typescript-eslint/consistent-type-exports": "warn", |
48 | | - "@typescript-eslint/consistent-type-imports": "warn", |
49 | | - "@typescript-eslint/explicit-function-return-type": "warn", |
50 | | - "@typescript-eslint/explicit-member-accessibility": "warn", |
51 | | - "@typescript-eslint/explicit-module-boundary-types": "warn", |
52 | | - "@typescript-eslint/member-ordering": "warn", //??? |
53 | | - "@typescript-eslint/method-signature-style": "warn", |
54 | | - //"@typescript-eslint/naming-convention": "warn" |
55 | | - "@typescript-eslint/no-base-to-string": "warn", |
56 | | - "@typescript-eslint/no-confusing-non-null-assertion": "warn", |
57 | | - "@typescript-eslint/no-confusing-void-expression": "warn", |
58 | | - "@typescript-eslint/no-duplicate-enum-values": "warn", |
59 | | - "@typescript-eslint/no-dynamic-delete": "warn", |
60 | | - "@typescript-eslint/no-empty-interface": "error", |
61 | | - "@typescript-eslint/no-explicit-any": "warn", |
62 | | - "@typescript-eslint/no-extra-non-null-assertion": "error", |
63 | | - "@typescript-eslint/no-extraneous-class": "warn", |
64 | | - "@typescript-eslint/no-floating-promises": "error", |
65 | | - "@typescript-eslint/no-for-in-array": "error", |
66 | | - "@typescript-eslint/no-inferrable-types": "error", |
67 | | - "@typescript-eslint/no-invalid-void-type": "warn", |
68 | | - "@typescript-eslint/no-meaningless-void-operator": "warn", |
69 | | - "@typescript-eslint/no-misused-new": "error", |
70 | | - "@typescript-eslint/no-misused-promises": "error", |
71 | | - "@typescript-eslint/no-namespace": "error", |
72 | | - "@typescript-eslint/no-non-null-asserted-nullish-coalescing": "warn", |
73 | | - "@typescript-eslint/no-non-null-asserted-optional-chain": "error", |
74 | | - "@typescript-eslint/no-non-null-assertion": "warn", |
75 | | - "@typescript-eslint/no-redundant-type-constituents": "warn", |
76 | | - "@typescript-eslint/no-require-imports": "warn", |
77 | | - "@typescript-eslint/no-this-alias": "error", |
78 | | - "@typescript-eslint/no-type-alias": "warn", |
79 | | - "@typescript-eslint/no-unnecessary-boolean-literal-compare": "warn", |
80 | | - "@typescript-eslint/no-unnecessary-condition": "warn", |
81 | | - "@typescript-eslint/no-unnecessary-qualifier": "warn", |
82 | | - "@typescript-eslint/no-unnecessary-type-arguments": "warn", |
83 | | - "@typescript-eslint/no-unnecessary-type-assertion": "error", |
84 | | - "@typescript-eslint/no-unnecessary-type-constraint": "error", |
85 | | - "@typescript-eslint/no-unsafe-argument": "error", |
86 | | - "@typescript-eslint/no-unsafe-assignment": "error", |
87 | | - "@typescript-eslint/no-unsafe-call": "error", |
88 | | - "@typescript-eslint/no-unsafe-declaration-merging": "warn", |
89 | | - "@typescript-eslint/no-unsafe-member-access": "error", |
90 | | - "@typescript-eslint/no-unsafe-return": "error", |
91 | | - "@typescript-eslint/no-useless-empty-export": "warn", |
92 | | - "@typescript-eslint/non-nullable-type-assertion-style": "warn", |
93 | | - "@typescript-eslint/parameter-properties": "warn", |
94 | | - "@typescript-eslint/prefer-as-const": "error", |
95 | | - "@typescript-eslint/prefer-enum-initializers": "warn", |
96 | | - "@typescript-eslint/prefer-for-of": "warn", |
97 | | - "@typescript-eslint/prefer-function-type": "warn", |
98 | | - "@typescript-eslint/prefer-includes": "warn", |
99 | | - "@typescript-eslint/prefer-literal-enum-member": "warn", |
100 | | - "@typescript-eslint/prefer-namespace-keyword": "error", |
101 | | - "@typescript-eslint/prefer-nullish-coalescing": "warn", |
102 | | - "@typescript-eslint/prefer-optional-chain": "warn", |
103 | | - "@typescript-eslint/prefer-readonly": "warn", |
104 | | - "@typescript-eslint/prefer-readonly-parameter-types": "warn", |
105 | | - "@typescript-eslint/prefer-reduce-type-parameter": "warn", |
106 | | - "@typescript-eslint/prefer-regexp-exec": "warn", |
107 | | - "@typescript-eslint/prefer-return-this-type": "warn", |
108 | | - "@typescript-eslint/prefer-string-starts-ends-with": "warn", |
109 | | - "@typescript-eslint/prefer-ts-expect-error": "warn", |
110 | | - "@typescript-eslint/promise-function-async": "warn", |
111 | | - "@typescript-eslint/require-array-sort-compare": "warn", |
112 | | - "@typescript-eslint/restrict-plus-operands": "error", |
113 | | - "@typescript-eslint/restrict-template-expressions": "error", |
114 | | - "@typescript-eslint/sort-type-constituents": "warn", |
115 | | - "@typescript-eslint/strict-boolean-expressions": "warn", |
116 | | - "@typescript-eslint/switch-exhaustiveness-check": "warn", |
117 | | - "@typescript-eslint/triple-slash-reference": "error", |
118 | | - "@typescript-eslint/typedef": "warn", |
119 | | - "@typescript-eslint/unbound-method": "error", |
120 | | - "@typescript-eslint/unified-signatures": "warn", |
121 | | - |
122 | | - "@typescript-eslint/no-use-before-define": "warn", |
123 | | - "@typescript-eslint/no-var-requires": "error", |
124 | | - |
125 | | - // Note: you must disable the base rule as it can report incorrect errors |
126 | | - "object-curly-spacing": "off", |
127 | | - "@typescript-eslint/object-curly-spacing": "warn" |
| 31 | + "prefer-arrow-callback": "off", |
| 32 | + "prefer-destructuring": "off", |
| 33 | + "comma-dangle": "off", |
| 34 | + "no-restricted-globals": "off", |
| 35 | + "no-restricted-properties": "off", |
| 36 | + "strict": "off", |
| 37 | + "no-unused-vars": "warn", |
| 38 | + "no-var": "off", |
| 39 | + "func-names": "off", |
| 40 | + "consistent-return": "off", |
| 41 | + "prefer-rest-params": "off", |
| 42 | + "radix": "off", |
| 43 | + "prefer-spread": "off", |
| 44 | + "no-plusplus": "off", |
| 45 | + "camelcase": "off", |
| 46 | + "no-use-before-define": "off", |
| 47 | + "no-lonely-if": "off", |
| 48 | + "no-restricted-syntax": "off", |
| 49 | + "vars-on-top": "off", |
| 50 | + "no-param-reassign": "off", |
| 51 | + "max-len": "off", |
| 52 | + "guard-for-in": "off", |
| 53 | + "no-underscore-dangle": "off", |
| 54 | + "no-bitwise": "off", |
| 55 | + "no-mixed-operators": "off", |
| 56 | + "object-shorthand": "off", |
| 57 | + "max-classes-per-file": "off", |
| 58 | + "block-spacing": [ |
| 59 | + "error", |
| 60 | + "always" |
| 61 | + ], |
| 62 | + "brace-style": [ |
| 63 | + "error", |
| 64 | + "1tbs" |
| 65 | + ], |
| 66 | + "comma-spacing": [ |
| 67 | + "error", |
| 68 | + { |
| 69 | + "before": false, |
| 70 | + "after": true |
| 71 | + } |
| 72 | + ], |
| 73 | + "comma-style": [ |
| 74 | + "error", |
| 75 | + "last" |
| 76 | + ], |
| 77 | + "computed-property-spacing": [ |
| 78 | + "error", |
| 79 | + "never" |
| 80 | + ], |
| 81 | + "curly": [ |
| 82 | + "error", |
| 83 | + "all" |
| 84 | + ], |
| 85 | + "eol-last": "off", |
| 86 | + "func-call-spacing": [ |
| 87 | + "error", |
| 88 | + "never" |
| 89 | + ], |
| 90 | + "indent": [ |
| 91 | + "error", |
| 92 | + 4 |
| 93 | + ], |
| 94 | + "key-spacing": [ |
| 95 | + "error", |
| 96 | + { |
| 97 | + "beforeColon": false, |
| 98 | + "afterColon": true |
| 99 | + } |
| 100 | + ], |
| 101 | + "keyword-spacing": [ |
| 102 | + "error", |
| 103 | + { |
| 104 | + "before": true, |
| 105 | + "after": true |
| 106 | + } |
| 107 | + ], |
| 108 | + "lines-between-class-members": [ |
| 109 | + "error", |
| 110 | + "always" |
| 111 | + ], |
| 112 | + "no-multi-spaces": [ |
| 113 | + "error" |
| 114 | + ], |
| 115 | + "no-trailing-spaces": [ |
| 116 | + "error", |
| 117 | + { |
| 118 | + "ignoreComments": true |
| 119 | + } |
| 120 | + ], |
| 121 | + "no-whitespace-before-property": [ |
| 122 | + "error" |
| 123 | + ], |
| 124 | + "object-curly-newline": [ |
| 125 | + "error", |
| 126 | + { |
| 127 | + "multiline": true, |
| 128 | + "consistent": true |
| 129 | + } |
| 130 | + ], |
| 131 | + "object-property-newline": [ |
| 132 | + "error", |
| 133 | + { |
| 134 | + "allowAllPropertiesOnSameLine": true |
| 135 | + } |
| 136 | + ], |
| 137 | + "semi": [ |
| 138 | + "error", |
| 139 | + "always" |
| 140 | + ], |
| 141 | + "semi-style": [ |
| 142 | + "error", |
| 143 | + "last" |
| 144 | + ], |
| 145 | + "space-before-blocks": [ |
| 146 | + "error", |
| 147 | + "always" |
| 148 | + ], |
| 149 | + "space-in-parens": [ |
| 150 | + "error", |
| 151 | + "never" |
| 152 | + ], |
| 153 | + "space-infix-ops": [ |
| 154 | + "error" |
| 155 | + ], |
| 156 | + "space-unary-ops": [ |
| 157 | + "error", |
| 158 | + { |
| 159 | + "words": true, |
| 160 | + "nonwords": false |
| 161 | + } |
| 162 | + ], |
| 163 | + "switch-colon-spacing": [ |
| 164 | + "error" |
| 165 | + ], |
| 166 | + "unicode-bom": [ |
| 167 | + "error", |
| 168 | + "never" |
| 169 | + ], |
| 170 | + "linebreak-style": [ |
| 171 | + "error", |
| 172 | + "unix" |
| 173 | + ], |
| 174 | + "no-useless-escape": "off", |
| 175 | + "no-useless-concat": "off", |
| 176 | + "quotes": [ |
| 177 | + "error", |
| 178 | + "double" |
| 179 | + ], |
| 180 | + "no-console": [ |
| 181 | + "off" |
| 182 | + ], |
| 183 | + "dot-notation": [ |
| 184 | + "error" |
| 185 | + ], |
| 186 | + "eqeqeq": [ |
| 187 | + "warn", |
| 188 | + "always" |
| 189 | + ], |
| 190 | + "no-alert": [ |
| 191 | + "error" |
| 192 | + ], |
| 193 | + "no-caller": [ |
| 194 | + "error" |
| 195 | + ], |
| 196 | + "no-eval": [ |
| 197 | + "error" |
| 198 | + ], |
| 199 | + "no-extend-native": [ |
| 200 | + "error" |
| 201 | + ], |
| 202 | + "no-iterator": [ |
| 203 | + "error" |
| 204 | + ], |
| 205 | + "no-loop-func": [ |
| 206 | + "error" |
| 207 | + ], |
| 208 | + "no-shadow": [ |
| 209 | + "error" |
| 210 | + ] |
128 | 211 | } |
129 | 212 | } |
0 commit comments