-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc
111 lines (106 loc) · 2.95 KB
/
.eslintrc
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.json",
"ecmaFeatures": {
"jsx": true
}
},
"plugins": ["@typescript-eslint", "jest", "react", "prettier", "react-hooks"],
"rules": {
// ESLint rules
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/member-delimiter-style": "error",
"@typescript-eslint/prefer-includes": 1,
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/consistent-type-assertions": "off",
"@typescript-eslint/require-await": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-types": "warn",
"@typescript-eslint/no-empty-interface": "error",
// Not necessary type assertion. Note: add types to be ignored in typesToIgnore
"@typescript-eslint/no-unnecessary-type-assertion": ["error", { "typesToIgnore": [] }],
"@typescript-eslint/no-inferrable-types": [
"warn",
{
"ignoreParameters": true
}
],
"no-unused-vars": [
"warn",
{
"vars": "all",
"args": "none"
}
],
"@typescript-eslint/no-unused-vars": [
"warn",
{
"vars": "all",
"args": "none"
}
],
"@typescript-eslint/no-explicit-any": [
"error",
{
"ignoreRestArgs": true
}
],
"@typescript-eslint/unbound-method": [
"error",
{
"ignoreStatic": true
}
],
// we want to check ".tsx" files
"react/jsx-filename-extension": [
"warn",
{
"extensions": [".jsx", ".tsx"]
}
],
"object-curly-spacing": ["warn", "always"],
// Not necessary in Typescript
"react/prop-types": "off",
"react/no-direct-mutation-state": "off",
"react/no-deprecated": "off",
"react/no-string-refs": "off",
"react/require-render-return": "off",
"react/jsx-props-no-spreading": "off",
"import/prefer-default-export": "off",
"react/jsx-boolean-value": "off",
"react/no-unescaped-entities": "off",
"react/jsx-one-expression-per-line": "off",
"react/jsx-wrap-multilines": "off",
"react/destructuring-assignment": "off",
"react/jsx-key": "error",
// React Hooks
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"prettier",
"prettier/react",
"prettier/@typescript-eslint"
],
"settings": {
"import/resolver": {
"node": {},
"typescript": {
"alwaysTryTypes": true
}
},
"react": {
"version": "detect"
}
}
}