-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy path.eslintrc.json
More file actions
113 lines (103 loc) · 3.34 KB
/
.eslintrc.json
File metadata and controls
113 lines (103 loc) · 3.34 KB
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
112
113
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"jsx": true
},
"extends": [
"eslint:recommended",
"problems",
"plugin:@typescript-eslint/recommended",
"plugin:react/all",
"prettier",
"prettier/@typescript-eslint"
],
"plugins": ["@typescript-eslint", "react", "react-hooks"],
"rules": {
"@typescript-eslint/explicit-function-return-type": "off",
"react/jsx-filename-extension": ["warn", {"extensions": [".tsx"]}],
"react/jsx-handler-names": [
"warn",
{"eventHandlerPrefix": "on", "eventHandlerPropPrefix": "on"}
],
// Common sources of bugs
"no-inner-declarations": "error",
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error",
// Potential syntax pitfalls
"no-bitwise": "warn",
"no-cond-assign": "warn",
// Other pitfalls?
"no-constant-condition": "warn",
"no-control-regex": "warn",
"no-duplicate-case": "warn",
"no-empty-character-class": "warn",
"no-ex-assign": "warn",
"no-extra-boolean-cast": "warn",
"no-invalid-regexp": "warn",
"no-regex-spaces": "warn",
"no-shadow": "warn",
"valid-typeof": "warn",
"prefer-template": "warn",
"no-sparse-arrays": "warn",
// Redundant because of TypeScript
"no-undef": "off",
"no-unused-vars": "off",
// Redundant because of Prettier
"react/jsx-indent": "off",
"react/jsx-indent-props": "off",
"react/jsx-closing-bracket-location": "off",
"react/jsx-max-depth": "off",
"react/jsx-max-props-per-line": "off",
"react/jsx-one-expression-per-line": "off",
"react/jsx-child-element-spacing": "off",
// Downgrade
// Annoying syntax quirks
"no-underscore-dangle": "warn",
// Questionable
"@typescript-eslint/prefer-interface": "off",
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/no-object-literal-type-assertion": "off",
"react/jsx-no-literals": "off",
"react/jsx-sort-props": "off",
"react/no-array-index-key": "off",
"react/no-set-state": "off",
"react/no-multi-comp": "off",
"react/button-has-type": "off",
"no-else-return": "off",
// Too ambitious
"react/display-name": "off",
"@typescript-eslint/no-non-null-assertion": "off",
// Other
"brace-style": ["warn", "1tbs", {"allowSingleLine": false}],
"camelcase": 1,
"comma-dangle": ["warn", "always-multiline"],
"comma-style": ["warn", "last"],
"curly": ["warn", "multi-line"],
"eol-last": "warn",
"eqeqeq": [1, "smart"],
"generator-star-spacing": ["warn", "before"],
"jsx-quotes": "warn",
"key-spacing": "warn",
"no-func-assign": "warn",
"no-lonely-if": 1,
"no-loop-func": 1,
"no-nested-ternary": 0,
"no-shadow-restricted-names": 1,
"no-throw-literal": "warn",
"object-curly-spacing": 0,
"radix": "warn",
"react/forbid-prop-types": "warn",
"react/jsx-curly-spacing": "warn",
"react/jsx-no-duplicate-props": "warn",
"react/jsx-no-undef": "warn",
"react/jsx-uses-react": "warn",
"react/jsx-uses-vars": "warn",
"react/no-did-mount-set-state": "warn",
"react/no-did-update-set-state": "warn",
"react/no-direct-mutation-state": "warn",
"react/no-unknown-property": "warn",
"react/prefer-es6-class": 1,
"react/react-in-jsx-scope": "warn",
"react/self-closing-comp": "warn"
}
}