-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc
92 lines (85 loc) · 2.85 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
{
"root": true,
"parser": "@typescript-eslint/parser",
"env": { "browser": true, "es2020": true },
"plugins": ["react-refresh"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended"
],
"ignorePatterns": ["build", ".eslintrc"],
"rules": {
// "react-refresh/only-export-components": [
// "warn",
// { "allowConstantExport": true }
// ]
"strict": ["warn", "never"],
// Possible Errors
"no-console": ["warn", { "allow": ["warn", "error"] }],
"no-template-curly-in-string": "warn",
// Best Practices
"no-multi-spaces": "warn",
"dot-location": ["warn", "property"],
"dot-notation": "warn",
"eqeqeq": "warn",
"no-eval": "warn",
"no-self-compare": "warn",
"yoda": "warn",
"no-trailing-spaces": "warn",
"react/button-has-type": "warn",
// TypeScript
"no-use-before-define": "off", // must disable the base rule as it can report incorrect errors
"@typescript-eslint/no-use-before-define": [
"warn",
{ "functions": false, "classes": true }
],
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/explicit-module-boundary-types": 0,
"@typescript-eslint/no-unused-vars": ["warn"],
// ECMAScript 6
"arrow-body-style": ["warn", "as-needed"],
"template-curly-spacing": ["warn", "never"],
"no-duplicate-imports": "warn",
"no-useless-constructor": "warn",
"no-var": "warn",
"prefer-const": "warn",
"prefer-rest-params": "warn",
"prefer-spread": "warn",
"rest-spread-spacing": ["warn", "never"],
// React/JSX Style Guide
"react/react-in-jsx-scope": "off",
"jsx-quotes": ["warn", "prefer-double"],
"react/no-multi-comp": ["warn", { "ignoreStateless": true }],
"react/prefer-stateless-function": [
"warn",
{ "ignorePureComponents": true }
],
"react/jsx-closing-tag-location": "warn",
"react/jsx-tag-spacing": [
"warn",
{
"closingSlash": "never",
"beforeSelfClosing": "always",
"afterOpening": "never",
"beforeClosing": "never"
}
],
"react/jsx-curly-spacing": ["warn", { "when": "never", "children": true }],
"react/jsx-pascal-case": ["warn", { "allowAllCaps": false }],
"react/jsx-boolean-value": ["warn", "never"],
"react/self-closing-comp": ["warn", { "component": true, "html": true }],
"react/jsx-no-bind": ["warn", { "allowArrowFunctions": true }],
"react/no-children-prop": "off"
// TODO: go to vitest
// Tests
// "jest/no-deprecated-functions": "error",
// "jest/prefer-called-with": "error",
// "jest/prefer-todo": "error",
// "jest/valid-title": "error",
// "jest/no-commented-out-tests": "error",
// "jest/prefer-to-be": 0
}
}