-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
50 lines (48 loc) · 2.33 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
import path from "node:path";
import { fileURLToPath } from "node:url";
import { includeIgnoreFile } from "@eslint/compat";
import stylistic from "@stylistic/eslint-plugin";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const gitignorePath = path.resolve(__dirname, ".gitignore");
export default [
includeIgnoreFile(gitignorePath),
{
files: ["**/*.js", "**/*.mjs"],
plugins: {
"@stylistic": stylistic
},
rules: {
"camelcase": ["error"],
"no-console": ["error", { allow: ["info", "warn"] }],
"@stylistic/indent": ["error", 2, { SwitchCase: 1 }],
"@stylistic/linebreak-style": ["error", process.platform === "win32" ? "windows" : "unix"],
"@stylistic/quotes": ["error", "double"],
"@stylistic/semi": ["error", "always"],
"@stylistic/no-extra-semi": "error",
"@stylistic/comma-dangle": ["error", "never"],
"@stylistic/space-before-function-paren": ["error", "always"],
"@stylistic/multiline-ternary": ["error", "never"],
"@stylistic/member-delimiter-style": ["error", { multiline: { delimiter: "semi" }, singleline: { delimiter: "comma" } }],
"@stylistic/arrow-spacing": ["error", { before: true, after: true }],
"@stylistic/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
"@stylistic/no-multi-spaces": "error",
"@stylistic/space-before-blocks": "error",
"@stylistic/no-trailing-spaces": "error",
"@stylistic/array-bracket-spacing": ["error", "never"],
"@stylistic/block-spacing": ["error", "always"],
"@stylistic/comma-spacing": ["error", { after: true, before: false }],
"@stylistic/comma-style": ["error", "last"],
"@stylistic/key-spacing": ["error", { afterColon: true, beforeColon: false }],
"@stylistic/keyword-spacing": ["error", { after: true, before: true }],
"@stylistic/object-curly-newline": "off",
"@stylistic/object-curly-spacing": ["error", "always"],
"@stylistic/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
"@stylistic/one-component-per-file": "off",
"@stylistic/require-default-prop": "off",
"@stylistic/space-in-parens": ["error", "never"],
"@stylistic/template-curly-spacing": "error",
"@stylistic/quote-props": ["error", "consistent-as-needed"]
}
}
];