|
1 |
| -import eslint from "@eslint/js"; |
| 1 | +import path from "node:path"; |
| 2 | +import { fileURLToPath } from "node:url"; |
| 3 | +import { includeIgnoreFile } from "@eslint/compat"; |
| 4 | +import stylistic from "@stylistic/eslint-plugin"; |
| 5 | + |
| 6 | +const __filename = fileURLToPath(import.meta.url); |
| 7 | +const __dirname = path.dirname(__filename); |
| 8 | +const gitignorePath = path.resolve(__dirname, ".gitignore"); |
2 | 9 |
|
3 | 10 | export default [
|
| 11 | + includeIgnoreFile(gitignorePath), |
4 | 12 | {
|
5 |
| - files: ["**/*.js"], |
6 |
| - ignores: [ |
7 |
| - "node_modules/**/*", |
8 |
| - "build/**/*", |
9 |
| - "dist/**/*", |
10 |
| - ".output/**/*", |
11 |
| - "docs/**/*", |
12 |
| - ], |
| 13 | + files: ["**/*.js", "**/*.mjs"], |
| 14 | + plugins: { |
| 15 | + "@stylistic": stylistic |
| 16 | + }, |
13 | 17 | rules: {
|
14 |
| - ...eslint.configs.recommended.rules, |
15 |
| - "indent": ["error", 2, { "SwitchCase": 1 }], |
16 |
| - "linebreak-style": ["error", "windows"], |
17 |
| - "quotes": ["error", "double"], |
18 |
| - "semi": ["error", "always"], |
19 |
| - "camelcase": "off", |
20 |
| - "arrow-spacing": ["error", { "before": true, "after": true }], |
21 |
| - "no-console": ["error", { |
22 |
| - "allow": ["info", "warn"] |
23 |
| - }], |
24 |
| - "brace-style": ["error", "stroustrup", { "allowSingleLine": true }], |
25 |
| - "no-multi-spaces": "error", |
26 |
| - "space-before-blocks": "error", |
27 |
| - "no-trailing-spaces": "error", |
28 |
| - "no-undef": "off" |
| 18 | + "camelcase": ["error"], |
| 19 | + "no-console": ["error", { allow: ["info", "warn"] }], |
| 20 | + "@stylistic/indent": ["error", 2, { SwitchCase: 1 }], |
| 21 | + "@stylistic/linebreak-style": ["error", process.platform === "win32" ? "windows" : "unix"], |
| 22 | + "@stylistic/quotes": ["error", "double"], |
| 23 | + "@stylistic/semi": ["error", "always"], |
| 24 | + "@stylistic/no-extra-semi": "error", |
| 25 | + "@stylistic/comma-dangle": ["error", "never"], |
| 26 | + "@stylistic/space-before-function-paren": ["error", "always"], |
| 27 | + "@stylistic/multiline-ternary": ["error", "never"], |
| 28 | + "@stylistic/member-delimiter-style": ["error", { multiline: { delimiter: "semi" }, singleline: { delimiter: "comma" } }], |
| 29 | + "@stylistic/arrow-spacing": ["error", { before: true, after: true }], |
| 30 | + "@stylistic/brace-style": ["error", "stroustrup", { allowSingleLine: true }], |
| 31 | + "@stylistic/no-multi-spaces": "error", |
| 32 | + "@stylistic/space-before-blocks": "error", |
| 33 | + "@stylistic/no-trailing-spaces": "error", |
| 34 | + "@stylistic/array-bracket-spacing": ["error", "never"], |
| 35 | + "@stylistic/block-spacing": ["error", "always"], |
| 36 | + "@stylistic/comma-spacing": ["error", { after: true, before: false }], |
| 37 | + "@stylistic/comma-style": ["error", "last"], |
| 38 | + "@stylistic/key-spacing": ["error", { afterColon: true, beforeColon: false }], |
| 39 | + "@stylistic/keyword-spacing": ["error", { after: true, before: true }], |
| 40 | + "@stylistic/object-curly-newline": "off", |
| 41 | + "@stylistic/object-curly-spacing": ["error", "always"], |
| 42 | + "@stylistic/object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }], |
| 43 | + "@stylistic/one-component-per-file": "off", |
| 44 | + "@stylistic/require-default-prop": "off", |
| 45 | + "@stylistic/space-in-parens": ["error", "never"], |
| 46 | + "@stylistic/template-curly-spacing": "error", |
| 47 | + "@stylistic/quote-props": ["error", "consistent-as-needed"] |
29 | 48 | }
|
30 | 49 | }
|
31 | 50 | ];
|
0 commit comments