-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
148 lines (142 loc) · 5.45 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
{
"env": {
"browser": true,
"es2021": true,
"node": true
},
"settings": {
"react": {
"version": "detect"
}
},
"extends": [
"prettier",
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:jsx-a11y/recommended"
],
"parserOptions": {
"project": ["./tsconfig.json", "./tsconfig.node.json"],
"tsconfigRootDir": "./"
},
"plugins": ["prettier", "react", "react-hooks", "@typescript-eslint", "import"],
"rules": {
"prettier/prettier": "error",
// no need to import react with react 18+
"react/jsx-uses-react": "off",
"react/react-in-jsx-scope": "off",
// react-hooks rules
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "error"
/* */
/* UNCOMMENT THESE RULES IF YOU WANNA GO HARDCORE MODE */
/* */
// // typescript-eslint rules
// "@typescript-eslint/no-var-requires": "off",
// "@typescript-eslint/no-unused-vars": ["error"],
// "@typescript-eslint/array-type": [
// "error",
// { "default": "array-simple", "readonly": "array-simple" }
// ],
// "@typescript-eslint/consistent-type-definitions": ["error", "type"],
// "@typescript-eslint/consistent-indexed-object-style": ["error", "record"],
// "@typescript-eslint/consistent-type-imports": "error",
// "@typescript-eslint/prefer-as-const": "error",
// "@typescript-eslint/unified-signatures": "error",
// "@typescript-eslint/sort-type-union-intersection-members": "error",
// "@typescript-eslint/prefer-optional-chain": "error",
// "@typescript-eslint/prefer-nullish-coalescing": "error",
// "@typescript-eslint/prefer-includes": "error",
// "@typescript-eslint/prefer-string-starts-ends-with": "error",
// "@typescript-eslint/require-array-sort-compare": "error",
// "@typescript-eslint/restrict-plus-operands": "warn",
// "@typescript-eslint/no-explicit-any": "warn",
// "@typescript-eslint/no-unnecessary-type-constraint": "error",
// "@typescript-eslint/no-dynamic-delete": "warn",
// "@typescript-eslint/explicit-function-return-type": "off",
// "@typescript-eslint/no-for-in-array": "error",
// "@typescript-eslint/switch-exhaustiveness-check": "error",
// "@typescript-eslint/await-thenable": "error",
// "@typescript-eslint/prefer-reduce-type-parameter": "error",
// // import plugin rules
// "import/group-exports": "error",
// // eslint rules
// "arrow-body-style": ["error", "as-needed"],
// "curly": ["error", "all"],
// "default-case": "error",
// "default-case-last": "error",
// "default-param-last": "error",
// "dot-notation": "error",
// "eqeqeq": "error",
// "func-style": ["error", "declaration", { "allowArrowFunctions": true }],
// "max-params": ["error", 4],
// "no-alert": "error",
// "max-depth": ["error", 3],
// "no-array-constructor": "error",
// "no-bitwise": "error",
// "no-console": "error",
// "no-delete-var": "error",
// "no-empty": "error",
// "no-eq-null": "error",
// "no-eval": "error",
// "no-extra-bind": "error",
// "no-extend-native": "error",
// "no-extra-boolean-cast": "error",
// "no-extra-label": "error",
// "no-floating-decimal": "error",
// "no-global-assign": "error",
// "no-implicit-coercion": "error",
// "no-implied-eval": "error",
// "no-invalid-this": "error",
// "no-labels": "error",
// "no-lone-blocks": "error",
// "no-lonely-if": "error",
// "no-loop-func": "error",
// "no-multi-assign": "error",
// "no-multi-str": "error",
// "no-new": "error",
// "no-new-func": "error",
// "no-new-object": "error",
// "no-new-wrappers": "error",
// "no-nonoctal-decimal-escape": "error",
// "no-octal": "error",
// "no-octal-escape": "error",
// "no-plusplus": "error",
// "no-proto": "error",
// "no-return-assign": "error",
// "no-return-await": "error",
// "no-script-url": "error",
// "no-sequences": "error",
// "no-throw-literal": "error",
// "no-undef-init": "error",
// "no-unneeded-ternary": "error",
// "no-useless-computed-key": "error",
// "no-useless-catch": "error",
// "no-useless-concat": "error",
// "no-useless-rename": "error",
// "no-with": "error",
// "object-shorthand": "error",
// "operator-assignment": ["error", "never"],
// "prefer-arrow-callback": "error",
// "prefer-const": "error",
// "prefer-destructuring": "error",
// "prefer-exponentiation-operator": "error",
// "prefer-numeric-literals": "error",
// "prefer-object-spread": "error",
// "prefer-promise-reject-errors": "error",
// "prefer-regex-literals": "error",
// "prefer-rest-params": "error",
// "prefer-spread": "error",
// "strict": ["error", "global"],
// "symbol-description": "error",
// "yoda": "error",
// "consistent-return": "warn",
// "func-names": ["error", "always"],
// "no-magic-numbers": "warn",
// "no-mixed-operators": "warn",
// "no-negated-condition": "warn",
// "no-param-reassign": "error",
// "no-shadow-restricted-names": "error"
}
}