-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy patheslint.config.mjs
More file actions
79 lines (78 loc) · 2.61 KB
/
eslint.config.mjs
File metadata and controls
79 lines (78 loc) · 2.61 KB
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 stylistic from "@stylistic/eslint-plugin";
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": stylistic,
},
rules: {
"@stylistic/array-bracket-spacing": "error",
"@stylistic/arrow-spacing": "error",
"@stylistic/block-spacing": ["error", "never"],
"@stylistic/brace-style": "error",
"@stylistic/comma-spacing": "error",
"@stylistic/comma-style": "error",
"@stylistic/computed-property-spacing": "error",
"@stylistic/dot-location": ["error", "property"],
"@stylistic/eol-last": "error",
"@stylistic/function-call-spacing": "error",
"@stylistic/indent": ["error", 2],
"@stylistic/key-spacing": "error",
"@stylistic/keyword-spacing": "error",
"@stylistic/linebreak-style": "error",
"@stylistic/new-parens": "error",
"@stylistic/no-extra-semi": "error",
"@stylistic/no-multi-spaces": "error",
"@stylistic/no-trailing-spaces": "warn",
"@stylistic/no-whitespace-before-property": "error",
"@stylistic/object-curly-spacing": "error",
"@stylistic/operator-linebreak": ["error", "after"],
"@stylistic/quotes": "error",
"@stylistic/rest-spread-spacing": "error",
"@stylistic/semi": "error",
"@stylistic/semi-spacing": "error",
"@stylistic/semi-style": "error",
"@stylistic/space-before-blocks": "error",
"@stylistic/space-before-function-paren": ["error", {anonymous: "always", named: "never", asyncArrow: "always"}],
"@stylistic/space-in-parens": "error",
"@stylistic/space-infix-ops": "error",
"@stylistic/space-unary-ops": "error",
"@stylistic/spaced-comment": "warn",
"@stylistic/switch-colon-spacing": "error",
"@stylistic/template-curly-spacing": "error",
},
},
];