-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
168 lines (164 loc) · 5.5 KB
/
.eslintrc.json
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
{
"env": {
"browser": true,
"es2021": true,
"jest": true
},
"extends": ["plugin:react/recommended", "airbnb"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["react", "@typescript-eslint", "prettier", "node"],
"rules": {
"prettier/prettier": ["error", { "requirePragma": false }],
"node/no-restricted-import": [
"error",
[
{
"name": "fs",
"message": "Please use { fs } from api/files"
}
]
],
"indent": "off", // handled by prettier
"operator-linebreak": "off", // handled by prettier
"space-before-function-paren": "off", // handled by prettier
"no-mixed-operators": "off",
"no-underscore-dangle": "off",
"comma-dangle": "off",
"spaced-comment": "off",
"object-curly-newline": "off",
"function-paren-newline": "off",
"react/prefer-stateless-function": "off",
"no-confusing-arrow": "off",
"newline-per-chained-call": "off",
"no-prototype-builtins": "off",
"implicit-arrow-linebreak": "off",
"object-curly-spacing": ["warn", "always"],
"max-len": ["error", 150],
"no-unused-vars": [
"error",
{
"vars": "all",
"argsIgnorePattern": "^_",
"args": "all",
"caughtErrors": "none",
"ignoreRestSiblings": true
}
],
//all warns are activated by default if removed
"prefer-promise-reject-errors": ["warn"],
"max-classes-per-file": ["warn"],
"padded-blocks": ["warn"],
"consistent-return": ["warn"],
"prefer-const": ["warn"],
"arrow-body-style": ["warn"],
"arrow-parens": ["off"], // handled by prettier
"prefer-template": ["warn"],
"no-tabs": ["warn"],
"object-shorthand": ["warn"],
"prefer-destructuring": ["warn"],
"class-methods-use-this": ["warn"],
"no-return-assign": ["warn"],
"no-param-reassign": ["warn"],
"array-callback-return": ["warn"],
"prefer-arrow-callback": ["warn"],
"jsx-quotes": ["warn"],
"object-property-newline": ["warn"],
"prefer-rest-params": ["warn"],
"import/no-mutable-exports": ["warn"],
"global-require": ["warn"],
"react/no-string-refs": ["warn"],
"no-unneeded-ternary": ["warn"],
"no-useless-escape": ["warn"],
"arrow-spacing": ["warn"],
"no-empty": ["warn"],
"no-cond-assign": ["warn"],
"no-multiple-empty-lines": ["warn"],
"lines-between-class-members": ["warn"],
"max-lines": ["warn", 250],
"max-params": ["warn", 4],
"max-lines-per-function": "off",
"max-statements": [
"warn",
{ "max": 10 },
{ "ignoreTopLevelFunctions": true }
],
//import
"import/no-duplicates": ["warn"],
"import/no-default-export": ["warn"],
"import/exports-last": ["warn"],
"import/no-named-as-default": ["warn"],
"import/prefer-default-export": ["off"],
"import/first": ["warn"],
"import/newline-after-import": ["warn"],
"import/extensions": "off",
"import/no-unresolved": "off",
"import/order": ["warn"],
"import/named": ["warn"],
"import/no-cycle": ["warn"],
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }],
//react
"react/static-property-placement": "off",
"react/no-deprecated": ["warn"],
"react/self-closing-comp": ["warn"],
"react/no-multi-comp": ["warn"],
"react/jsx-closing-bracket-location": ["warn"],
"react/jsx-boolean-value": ["warn"],
"react/jsx-indent": ["off"], // handled by prettier,
"react/jsx-indent-props": ["warn"],
"react/no-array-index-key": ["warn"],
"react/jsx-props-no-spreading": ["warn"],
"react/jsx-first-prop-new-line": ["warn"],
"react/no-unused-state": ["warn"],
"react/jsx-wrap-multilines": ["off"], // handled by prettier,
"react/jsx-curly-brace-presence": ["warn"],
"react/jsx-curly-newline": "off",
"react/require-default-props": [
"warn",
{ "forbidDefaultForRequired": false, "ignoreFunctionalComponents": true }
],
"react/forbid-prop-types": ["warn"],
"react/jsx-no-bind": ["warn"],
"react/sort-comp": ["warn"],
"react/jsx-closing-tag-location": ["warn"],
"react/jsx-max-props-per-line": ["warn"],
"react/no-unescaped-entities": ["warn"],
"react/no-unused-prop-types": ["warn"],
"react/jsx-no-target-blank": ["warn"],
"react/jsx-filename-extension": "off",
"react/jsx-tag-spacing": "off",
"react/destructuring-assignment": ["off"],
"react/jsx-one-expression-per-line": "off",
"import/no-useless-path-segments": ["warn"],
"react/button-has-type": ["warn"],
"react/no-access-state-in-setstate": ["warn"],
"react/jsx-pascal-case": ["warn"],
"react/default-props-match-prop-types": [
"error",
{ "allowRequiredDefaults": true }
],
"react/function-component-definition": [
2,
{ "namedComponents": "arrow-function" }
],
//jsx-a11y
"jsx-a11y/anchor-is-valid": ["warn"],
"jsx-a11y/label-has-for": ["off"],
"jsx-a11y/html-has-lang": ["warn"],
"jsx-a11y/iframe-has-title": ["warn"],
"jsx-a11y/tabindex-no-positive": ["warn"],
"jsx-a11y/no-noninteractive-element-interactions": ["warn"],
"jsx-a11y/control-has-associated-label": ["warn"],
"jsx-a11y/alt-text": ["warn"],
"jsx-a11y/no-static-element-interactions": "off",
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/mouse-events-have-key-events": "off",
"jsx-a11y/label-has-associated-control": "off"
}
}