-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
54 lines (54 loc) · 2.35 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: "latest",
sourceType: "module",
},
plugins: ["react", "@typescript-eslint"],
settings: {
react: {
version: "detect", // React version. "detect" automatically picks the version you have installed.
},
},
rules: {
// Rules to apply on top of the baseline ones (from "extends")
// FYI, to see all the rule settings, run "eslint --print-config *.ts"
"prettier/prettier": "off",
"no-var": "warn",
"prefer-const": "warn",
"no-useless-escape": "off",
"no-warning-comments": [
1,
{ terms: ["nocommit"], location: "anywhere" },
],
// Downgraded from error to warnings
"@typescript-eslint/no-empty-function": "warn",
"@typescript-eslint/no-empty-interface": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": "warn",
"no-case-declarations": "warn",
"prefer-rest-params": "warn",
"prefer-spread": "warn",
// Disabled
"@typescript-eslint/ban-types": "off", // Record<string, never> is not intuitive for us compared to {}
"@typescript-eslint/no-inferrable-types": "off", // not worth worrying about (not even convinced it's a problem at all)
"@typescript-eslint/no-var-requires": "off", // I think you need this syntax in React Native for getting assets, AFAIK.
"@typescript-eslint/triple-slash-reference": "off", // a lot of our legacy code still uses this
"react/no-unescaped-entities": "off", // Complains about some special chars that sort of work, but due to the burden that enocded chars present to localizers, we'd prefer not to encode them if not necessary.
"react/prop-types": "off", // Seems to require validation on the props parameter itself, but Typescript can already figure out the types through annotations in different places, seems unnecessary
},
};