-
Notifications
You must be signed in to change notification settings - Fork 45
/
.eslintrc
178 lines (178 loc) · 5.15 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
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
169
170
171
172
173
174
175
176
177
178
{
"env": {
"browser": true,
"es2021": true,
"jest": true
},
"extends": [
"airbnb",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"prettier",
"plugin:json-schema-validator/recommended",
"plugin:jsonc/recommended-with-json",
"plugin:jsonc/recommended-with-jsonc",
"plugin:jsonc/recommended-with-json5"
],
"plugins": ["unicorn", "import", "react", "prettier", "jsonc"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 12,
"sourceType": "module"
},
"settings": {
"import/parsers": {
"@typescript-eslint/parser": [
".ts",
".tsx"
]
},
"import/resolver": {
"typescript": {
"alwaysTryTypes": true
}
}
},
"overrides": [
{
"files": ["*.json6", "*.json", "*/**.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"max-lines": "off"
}
},
{
"files": ["**/cypress/*.ts", "*test.ts", "*test.tsx"],
"rules": {
"react/react-in-jsx-scope": "off"
}
},
{
"files": ["**/*.js"],
"rules": {"react/prop-types": "off"}
}
],
"rules": {
"indent": ["error", 2],
"import/no-unresolved": "error",
"import/extensions": "off",
"react/jsx-filename-extension": [
1,
{
"extensions": [
".js",
".jsx",
".tsx"
]
}
],
"react/destructuring-assignment": "off",
"curly": [
"error",
"multi-line",
"consistent"
],
"object-curly-newline": "error",
"react/jsx-props-no-spreading": "off",
"react/no-array-index-key": "off",
"react/require-default-props": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/no-static-element-interactions": "off",
"import/no-extraneous-dependencies": [
"error",
{ "devDependencies": ["**/*.test.tsx", "**/*.test.ts", "**/*.stories.tsx"] }
],
"no-shadow": "off",
"@typescript-eslint/no-shadow": "off",
"function-paren-newline": "off",
"@typescript-eslint/no-explicit-any": "error",
"react/function-component-definition": [
2,
{ "namedComponents": "arrow-function" }
],
"@typescript-eslint/no-unused-vars": [
"error",
{ "ignoreRestSiblings": true, "varsIgnorePattern": "^CatchErr" }
],
"@typescript-eslint/no-non-null-asserted-optional-chain": "off",
"jsx-a11y/no-autofocus": "off",
"import/prefer-default-export": "off",
"import/no-default-export": "warn",
"camelcase": ["warn", {
"properties": "always"
}],
"jsx-a11y/aria-role": "off",
"jsx-a11y/label-has-associated-control": "off",
"no-empty": ["error", { "allowEmptyCatch": true }],
"no-console": "error",
"no-underscore-dangle": "off",
"no-plusplus": "off",
"jsx-a11y/anchor-is-valid": "off",
"react/no-access-state-in-setstate": "off",
"react/sort-comp": "off",
"no-unused-expressions": ["error", { "allowTernary": true }],
"unicorn/filename-case": [
"error",
{ "cases": { "camelCase": true, "pascalCase": true, "kebabCase": true } }
],
"unicorn/no-instanceof-array": "error",
"unicorn/no-static-only-class": "error",
"unicorn/consistent-destructuring": "error",
"unicorn/better-regex": "error",
"unicorn/no-for-loop": "error",
"unicorn/prefer-array-some": "error",
"unicorn/prefer-array-find": "error",
"unicorn/no-lonely-if": "error",
"unicorn/prefer-includes": "error",
"unicorn/prefer-array-flat-map": "error",
"unicorn/no-useless-spread": "error",
"unicorn/no-useless-length-check": "error",
"unicorn/prefer-export-from": "error",
"max-depth": ["error", { "max": 3 }],
"max-lines": ["error", { "max": 647 }],
"max-params": ["error", { "max": 5 }],
"@typescript-eslint/no-unnecessary-type-constraint": "off",
"no-useless-constructor": "error",
"@typescript-eslint/no-useless-constructor": ["error"],
"class-methods-use-this": "off",
"react/jsx-no-useless-fragment": ["error", { "allowExpressions": true }],
"import/order": ["warn", {
"newlines-between": "always"
}],
"react/no-unstable-nested-components": ["error", { "allowAsProps": true }],
"function-call-argument-newline": "off",
"max-classes-per-file": ["error", 10],
"quotes": [
"error",
"single",
{
"avoidEscape": true,
"allowTemplateLiterals": true
}
],
"jsonc/array-bracket-newline": ["error", {
"multiline": true,
"minItems": null
}],
"jsonc/array-bracket-spacing": ["error", "never"],
"jsonc/indent": ["error", 2],
"jsonc/comma-style": ["error", "last"],
"jsonc/key-spacing": ["error", {
"beforeColon": false,
"afterColon": true,
"mode": "strict"
}],
"jsonc/object-curly-newline": ["error", {
"consistent": true
}],
"jsonc/object-curly-spacing": ["error", "never"],
"jsonc/object-property-newline": ["error", {
"allowAllPropertiesOnSameLine": false
}],
"import/no-dynamic-require": ["warn"]
}
}