| 1 | import process from "node:process" |
| 2 | import antfu from "@antfu/eslint-config" |
| 3 | |
| 4 | const isProduction = process.env.NODE_ENV === "production" |
| 5 | |
| 6 | export default antfu( |
| 7 | { |
| 8 | vue: true, |
| 9 | typescript: true, |
| 10 | javascript: true, |
| 11 | jsx: true, |
| 12 | |
| 13 | stylistic: { |
| 14 | indent: "tab", |
| 15 | quotes: "double" |
| 16 | }, |
| 17 | rules: { |
| 18 | "@typescript-eslint/no-non-null-assertion": "error", |
| 19 | "antfu/if-newline": "off", |
| 20 | "e18e/ban-dependencies": ["error", { allowed: ["axios", "lodash", "depcheck", "fs-extra"] }], |
| 21 | "pnpm/yaml-enforce-settings": isProduction ? "error" : "off", |
| 22 | "style/operator-linebreak": "off", |
| 23 | "style/arrow-parens": "off", |
| 24 | "style/brace-style": "off", |
| 25 | "style/indent-binary-ops": "off", |
| 26 | "style/indent": "off", |
| 27 | "style/member-delimiter-style": "off", |
| 28 | "style/quotes": "off", |
| 29 | "style/quote-props": "off", |
| 30 | "style/eol-last": "off", |
| 31 | "style/no-mixed-spaces-and-tabs": "off", |
| 32 | "style/comma-dangle": [ |
| 33 | "error", |
| 34 | { |
| 35 | arrays: "never", |
| 36 | objects: "never", |
| 37 | imports: "never", |
| 38 | exports: "never", |
| 39 | functions: "never" |
| 40 | } |
| 41 | ] |
| 42 | } |
| 43 | }, |
| 44 | { |
| 45 | files: ["**/*.vue"], |
| 46 | rules: { |
| 47 | "vue/block-order": [ |
| 48 | "error", |
| 49 | { |
| 50 | order: ["template", "script", "style"] |
| 51 | } |
| 52 | ], |
| 53 | "vue/component-name-in-template-casing": "off", |
| 54 | "vue/custom-event-name-casing": "off", |
| 55 | "vue/html-self-closing": "off", |
| 56 | "vue/singleline-html-element-content-newline": "off", |
| 57 | "vue/comma-dangle": "off", |
| 58 | "vue/quote-props": "off", |
| 59 | "vue/one-component-per-file": "off", |
| 60 | "vue/prefer-true-attribute-shorthand": "error", |
| 61 | "vue/v-bind-style": ["error", "shorthand", { sameNameShorthand: "always" }], |
| 62 | "style/multiline-ternary": "off" |
| 63 | } |
| 64 | } |
| 65 | ) |