-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.json
178 lines (178 loc) · 4.43 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
169
170
171
172
173
174
175
176
177
178
{
"ignorePatterns": ["environment.d.ts", ".eslintrc.json"],
"env": {
"jest/globals": true
},
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"next/core-web-vitals",
"next",
"prettier",
"plugin:@next/next/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": ["@typescript-eslint", "eslint-plugin-import-helpers", "prettier"],
"overrides": [
{
"files": ["*.ts", "*.tsx"],
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"project": ["./tsconfig.json"],
"ecmaVersion": 12,
"sourceType": "module"
},
"rules": {
"no-undef": "off",
"import-helpers/order-imports": [
"error",
{
"newlinesBetween": "always",
"groups": ["module", ["parent", "index", "sibling"]],
"alphabetize": {"order": "asc", "ignoreCase": true}
}
],
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "default",
"format": ["camelCase", "UPPER_CASE", "PascalCase", "snake_case"],
"leadingUnderscore": "allow"
},
{
"selector": "typeLike",
"format": ["PascalCase"],
"custom": {
"regex": "^I[A-Z]",
"match": false
}
}
]
}
},
{
"files": ["*.test.ts", "*.test.tsx"],
"plugins": ["jest"],
"extends": ["plugin:jest/recommended"],
"rules": {
"@typescript-eslint/unbound-method": "off",
"jest/prefer-strict-equal": "error",
"jest/prefer-todo": "error",
"jest/unbound-method": "error",
"jest/prefer-spy-on": "error",
"jest/prefer-mock-promise-shorthand": "error",
"jest/prefer-expect-resolves": "error",
"jest/prefer-comparison-matcher": "error",
"jest/max-nested-describe": ["error", {"max": 2}],
"jest/prefer-lowercase-title": [
"error",
{
"ignore": ["describe"]
}
],
"jest/consistent-test-it": [
"error",
{"fn": "it", "withinDescribe": "test"}
],
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "default",
"format": ["camelCase", "UPPER_CASE", "PascalCase", "snake_case"],
"leadingUnderscore": "allow"
}
]
}
}
],
"rules": {
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/naming-convention": [
"error",
{
"selector": "enum",
"format": ["PascalCase"],
"suffix": ["Enum"]
}
],
"@typescript-eslint/array-type": [
"error",
{
"default": "generic"
}
],
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/consistent-generic-constructors": "error",
"@typescript-eslint/consistent-indexed-object-style": "error",
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"@typescript-eslint/indent": "off",
"@typescript-eslint/no-duplicate-enum-values": "error",
"@typescript-eslint/no-shadow": "warn",
"@typescript-eslint/no-use-before-define": "error",
"class-methods-use-this": "off",
"import/prefer-default-export": 0,
"no-nested-ternary": "warn",
"no-shadow": "off",
"no-unreachable": "error",
"no-unused-vars": "off",
// "no-restricted-imports": [
// "warn",
// {
// "patterns": [
// {
// "group": ["../*"],
// "message": "Usage of relative parent imports is not allowed."
// }
// ]
// }
// ],
"react-hooks/exhaustive-deps": "warn",
"react-hooks/rules-of-hooks": "error",
"react/button-has-type": "off",
"react/display-name": "warn",
"react/jsx-props-no-spreading": "off",
"react/jsx-boolean-value": "error",
"react/jsx-closing-bracket-location": "error",
"react/jsx-closing-tag-location": "error",
"react/jsx-curly-newline": "off",
"react/jsx-filename-extension": ["error", {"extensions": [".tsx", ".jsx"]}],
"react/jsx-indent-props": [2, "tab"],
"react/jsx-indent": "off",
"no-console": "warn",
"react/jsx-tag-spacing": [
2,
{
"beforeSelfClosing": "always"
}
],
"react/jsx-wrap-multilines": [
2,
{
"declaration": "parens-new-line",
"assignment": "parens-new-line",
"return": "parens-new-line",
"arrow": "ignore",
"condition": "ignore",
"logical": "ignore",
"prop": "ignore"
}
],
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-unused-vars": "warn",
"no-inline-comments": "warn",
"prefer-destructuring": [
"warn",
{
"array": true,
"object": true
},
{
"enforceForRenamedProperties": false
}
]
}
}