-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
30 lines (28 loc) · 1.11 KB
/
eslint.config.mjs
File metadata and controls
30 lines (28 loc) · 1.11 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
import js from "@eslint/js";
import globals from "globals";
import { defineConfig } from "eslint/config";
import stylistic from "@stylistic/eslint-plugin";
export default defineConfig([
{ files: ["**/*.{js,mjs,cjs}"], plugins: { js }, extends: ["js/recommended"] },
{ files: ["**/*.js"], languageOptions: { sourceType: "commonjs" } },
{ files: ["src/**/*.js", "test/**/*.js"], languageOptions: { sourceType: "module" } },
{ files: ["**/*.{js,mjs,cjs}"], languageOptions: { globals: globals.node } },
{
files: ["**/*.{js,mjs,cjs}"],
plugins: {
"@stylistic": stylistic
},
rules: {
"@stylistic/semi": ["error", "always"],
"@stylistic/quotes": ["error", "single"],
"@stylistic/indent": ["error", 2],
"@stylistic/comma-dangle": ["error", "only-multiline"],
"@stylistic/no-trailing-spaces": "error",
"@stylistic/space-before-blocks": "error",
"@stylistic/keyword-spacing": "error",
"@stylistic/comma-spacing": "error",
"@stylistic/object-curly-spacing": ["error", "always"],
"@stylistic/array-bracket-spacing": ["error", "never"]
}
}
]);