-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy patheslint.config.js
84 lines (78 loc) · 2.52 KB
/
eslint.config.js
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
import reactRecommended from "eslint-plugin-react/configs/recommended.js";
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import stylisticTs from "@stylistic/eslint-plugin-ts";
import stylistic from "@stylistic/eslint-plugin";
export default [
eslint.configs.recommended,
...tseslint.configs.recommended,
reactRecommended,
{
"plugins": {
"@stylistic": stylistic,
"@stylistic/ts": stylisticTs,
},
"settings": {
"react": {
"version": "18.2",
},
},
"rules": {
// eslint - https://eslint.org/docs/latest/rules/
"eqeqeq": ["error"],
"vars-on-top": ["error"],
"no-eq-null": ["error"],
"no-label-var": ["error"],
"camelcase": ["error"],
"no-multi-assign": ["error"],
"no-var": ["error"],
"prefer-const": ["error"],
"no-console": ["error"],
"no-constant-condition": [0],
"object-curly-spacing": [2, "always"],
"indent": [
"error",
2,
],
// react
"react/jsx-pascal-case": "error",
"react/jsx-uses-vars": ["error"],
"react/react-in-jsx-scope": [0],
// react-hooks - temporarily disabled
// "react-hooks/rules-of-hooks": "error",
// @typescript-eslint
"@typescript-eslint/ban-ts-comment": [0],
"@typescript-eslint/no-use-before-define": ["error"],
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_",
},
],
// @stylistic - https://eslint.style/packages/default#rules
"@stylistic/linebreak-style": [
"error",
"unix",
],
"@stylistic/no-mixed-spaces-and-tabs": ["error"],
"@stylistic/operator-linebreak": ["error", "before"],
"@stylistic/max-len": ["error", { "code": 80 }],
"@stylistic/no-trailing-spaces": ["error"],
"@stylistic/eol-last": ["error", "always"],
"@stylistic/dot-location": ["error", "property"],
"@stylistic/type-annotation-spacing": "error",
// @stylistic/ts - https://eslint.style/packages/ts#rules
"@stylistic/ts/comma-dangle": ["error", "always-multiline"],
"@stylistic/ts/semi": ["error", "always"],
"@stylistic/ts/space-before-blocks": ["error", "always"],
"@stylistic/ts/quotes": [
"error",
"double",
],
"@stylistic/ts/key-spacing": ["error", { "beforeColon": false }],
"@stylistic/ts/keyword-spacing": ["error"],
},
},
];