-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.json
185 lines (185 loc) · 5.06 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
179
180
181
182
183
184
185
{
"env": {
"es2021": true,
"browser": true,
"node": true,
"jquery": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module",
"project": "./tsconfig.json"
},
"extends": [
"airbnb",
"airbnb-typescript",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"plugins": [
"prefer-arrow",
"@typescript-eslint",
"unused-imports",
"eslint-plugin-tsdoc"
],
"globals": {
"window": true,
"lazySizes": true
},
"rules": {
"import/extensions": 0,
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": true,
"optionalDependencies": false
}
],
"sort-imports": 0,
"import/order": [
"error",
{
"groups": ["builtin", "external", "internal"],
"alphabetize": {
"order": "asc"
},
"newlines-between": "never"
}
],
"import/prefer-default-export": "off",
"import/no-default-export": "error",
"prefer-arrow/prefer-arrow-functions": [
"warn",
{
"disallowPrototype": true,
"singleReturnOnly": false,
"classPropertiesAllowed": false
}
],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"error",
{
"vars": "all",
"varsIgnorePattern": "^Window$",
"args": "after-used",
"argsIgnorePattern": "^_"
}
],
"no-alert": 0,
"no-console": 0,
"tsdoc/syntax": "warn",
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/interface-name-prefix": 0,
"@typescript-eslint/naming-convention": [
"error",
{
"selector": ["variable", "function", "parameter"],
"format": ["camelCase"],
"leadingUnderscore": "allow"
},
{
"selector": "variable",
"types": ["boolean"],
"format": ["PascalCase"],
"prefix": ["is", "should"]
},
{
"selector": "class",
"format": ["PascalCase"]
},
{
"selector": "interface",
"format": ["PascalCase"]
},
{
"selector": "typeParameter",
"format": ["PascalCase"],
"prefix": ["T", "K"]
},
{
"selector": "enum",
"format": ["PascalCase"]
}
],
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/prefer-nullish-coalescing": "error",
"@typescript-eslint/prefer-optional-chain": "error",
"prettier/prettier": "error"
},
"settings": {
"react": {
"version": "detect"
},
"import/extensions": [".js", ".jsx", ".json", ".ts", ".tsx"]
// "import/resolver": {
// "webpack": {
// "config": "webpack.config.js"
// }
// }
},
"overrides": [
// Configuration for TypeScript files
{
"files": ["**/*.tsx"],
"plugins": ["react", "react-refresh", "jsx-a11y", "tailwindcss"],
"extends": [
"plugin:react-hooks/recommended",
"plugin:jsx-a11y/recommended",
"plugin:tailwindcss/recommended",
"plugin:@tanstack/eslint-plugin-query/recommended"
],
"rules": {
"react/destructuring-assignment": "off", // Vscode doesn't support automatically destructuring, it's a pain to add a new variable
"jsx-a11y/anchor-is-valid": "off", // Next.js use his own internal link system
"jsx-a11y/label-has-associated-control": [
2,
{
"assert": "either" // either check for `htmlFor` or `nesting`
}
],
"react/require-default-props": "off", // Allow non-defined react props as undefined
"react/jsx-props-no-spreading": "off", // _app.tsx uses spread operator and also, react-hook-form
// "react-hooks/exhaustive-deps": "off", // Incorrectly report needed dependency with Next.js router
"react/function-component-definition": [
2,
{
"namedComponents": "arrow-function",
"unnamedComponents": "arrow-function"
}
],
"react/no-danger": "off", // Allow dangerouslySetInnerHTML
"react/react-in-jsx-scope": "off",
"react/jsx-uses-react": "off",
"react-refresh/only-export-components": [
"warn",
{ "allowConstantExport": true }
],
"import/no-default-export": "off",
"import/order": [
"error",
{
"groups": ["builtin", "external", "internal"],
"pathGroups": [
{
"pattern": "react",
"group": "external",
"position": "before"
}
],
"pathGroupsExcludedImportTypes": ["react"],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
],
"@typescript-eslint/naming-convention": "off",
"tailwindcss/no-custom-classname": "off"
}
}
]
}