-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
124 lines (110 loc) · 4.44 KB
/
eslint.config.mjs
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
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import stylistic from "@stylistic/eslint-plugin";
/** @type {import("@typescript-eslint/utils").TSESLint.FlatConfig.ConfigFile} */
export default [
{ files: ["**/*.{js,mjs,cjs,ts}"] },
{ files: ["**/*.js"], languageOptions: { sourceType: "script" } },
{ languageOptions: { globals: globals.node } },
pluginJs.configs.recommended,
...tseslint.configs.recommended,
{
plugins: {
"@stylistic": stylistic,
},
rules: {
// Spacing
"@stylistic/arrow-spacing": ["error", {
before: true,
after: true,
}],
"@stylistic/block-spacing": ["error", "always"],
"@stylistic/comma-spacing": ["error", {
before: false,
after: true,
}],
"@stylistic/computed-property-spacing": ["error", "never"],
"@stylistic/generator-star-spacing": ["error", "before"],
"@stylistic/key-spacing": ["error", {
beforeColon: false,
afterColon: true,
mode: "strict"
}],
"@stylistic/keyword-spacing": ["error", {
before: true,
after: true,
}],
"@stylistic/no-mixed-spaces-and-tabs": "error",
"@stylistic/no-trailing-spaces": "error",
"@stylistic/no-whitespace-before-property": "error",
"@stylistic/object-curly-spacing": ["error", "always"],
"@stylistic/rest-spread-spacing": ["error", "never"],
"@stylistic/semi-spacing": ["error", {
before: false,
after: true,
}],
"@stylistic/space-before-blocks": ["error", "always"],
"@stylistic/space-before-function-paren": ["error", {
anonymous: "always",
named: "never",
asyncArrow: "always"
}],
"@stylistic/space-in-parens": ["error", "never"],
"@stylistic/space-infix-ops": "error",
"@stylistic/space-unary-ops": "error",
"@stylistic/spaced-comment": ["error", "always"],
"@stylistic/switch-colon-spacing": ["error", {
before: false,
after: true,
}],
"@stylistic/template-curly-spacing": ["error", "never"],
"@stylistic/type-annotation-spacing": ["error", {
before: false,
after: true,
}],
"@stylistic/type-generic-spacing": ["error"],
"@stylistic/type-named-tuple-spacing": ["error"],
"@stylistic/yield-star-spacing": ["error", "after"],
//
"@stylistic/eol-last": ["error", "always"],
"@stylistic/linebreak-style": ["error", "unix"],
"@stylistic/indent": ["error", 4],
"@stylistic/quote-props": ["error", "as-needed"],
"@stylistic/quotes": ["error", "double"],
"@stylistic/comma-style": ["error", "last"],
"@stylistic/semi": ["error", "always"],
"@stylistic/semi-style": ["error", "last"],
"@stylistic/dot-location": ["error", "property"],
"@stylistic/lines-around-comment": ["error", {
beforeBlockComment: true,
beforeLineComment: true,
allowBlockStart: true,
allowBlockEnd: true,
allowObjectStart: true,
allowObjectEnd: true,
allowArrayStart: true,
allowArrayEnd: true,
allowClassStart: true,
allowClassEnd: true,
afterHashbangComment: true,
}],
"@stylistic/no-confusing-arrow": ["error", {
allowParens: true,
onlyOneSimpleParam: false
}],
"@stylistic/no-extra-parens": ["error", "all"],
"@stylistic/no-extra-semi": "error",
"@stylistic/no-floating-decimal": "error",
"@stylistic/no-mixed-operators": "error",
"@stylistic/no-multi-spaces": ["error", {
ignoreEOLComments: true
}],
"@stylistic/no-multiple-empty-lines": ["error", {
max: 2
}],
"@stylistic/no-tabs": "error",
"@stylistic/padded-blocks": ["error", "never"],
}
}
];