-
Notifications
You must be signed in to change notification settings - Fork 9
/
eslint.config.mjs
79 lines (78 loc) · 2.72 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
import js from "@eslint/js";
import stylisticJs from "@stylistic/eslint-plugin-js";
import globals from "globals";
export default [
{
ignores: ["dist/*", "vite.config.mjs"],
},
{
files: ["src/**/*.mjs", "eslint.config.mjs"],
languageOptions: {
ecmaVersion: 2024,
sourceType: "module",
globals: {
...globals.browser,
...globals.nodeBuiltin,
},
},
},
js.configs.recommended,
{
rules: {
curly: "error",
eqeqeq: "error",
"dot-notation": "error",
"new-cap": "error",
"no-console": ["error", {allow: ["info", "warn", "error"]}],
"no-unneeded-ternary": "warn",
"no-useless-call": "error",
"no-useless-computed-key": "error",
"no-var": "error",
"object-shorthand": "warn",
"operator-assignment": "warn",
"prefer-arrow-callback": ["error", {allowNamedFunctions: true}],
"prefer-rest-params": "error",
}
},
{
plugins: {
"@stylistic/js": stylisticJs,
},
rules: {
"@stylistic/js/array-bracket-spacing": "error",
"@stylistic/js/arrow-spacing": "error",
"@stylistic/js/block-spacing": ["error", "never"],
"@stylistic/js/brace-style": "error",
"@stylistic/js/comma-spacing": "error",
"@stylistic/js/comma-style": "error",
"@stylistic/js/computed-property-spacing": "error",
"@stylistic/js/dot-location": ["error", "property"],
"@stylistic/js/eol-last": "error",
"@stylistic/js/function-call-spacing": "error",
"@stylistic/js/indent": ["error", 2],
"@stylistic/js/key-spacing": "error",
"@stylistic/js/keyword-spacing": "error",
"@stylistic/js/linebreak-style": "error",
"@stylistic/js/new-parens": "error",
"@stylistic/js/no-extra-semi": "error",
"@stylistic/js/no-multi-spaces": "error",
"@stylistic/js/no-trailing-spaces": "warn",
"@stylistic/js/no-whitespace-before-property": "error",
"@stylistic/js/object-curly-spacing": "error",
"@stylistic/js/operator-linebreak": ["error", "after"],
"@stylistic/js/quotes": "error",
"@stylistic/js/rest-spread-spacing": "error",
"@stylistic/js/semi": "error",
"@stylistic/js/semi-spacing": "error",
"@stylistic/js/semi-style": "error",
"@stylistic/js/space-before-blocks": "error",
"@stylistic/js/space-before-function-paren": ["error", {anonymous: "always", named: "never", asyncArrow: "always"}],
"@stylistic/js/space-in-parens": "error",
"@stylistic/js/space-infix-ops": "error",
"@stylistic/js/space-unary-ops": "error",
"@stylistic/js/spaced-comment": "warn",
"@stylistic/js/switch-colon-spacing": "error",
"@stylistic/js/template-curly-spacing": "error",
},
},
];