/** * @type {import("eslint").Linter.Config} */ module.exports = { root: true, env: { node: true, browser: true, "vue/setup-compiler-macros": true, }, parser: "@typescript-eslint/parser", parserOptions: { ecmaVersion: "2021", sourceType: "module", ecmaFeatures: { jsx: true, }, tsconfigRootDir: "./", project: ["tsconfig.json"], extraFileExtensions: [".vue"], }, plugins: ["@typescript-eslint"], extends: [ "eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/recommended-requiring-type-checking", "plugin:vue/vue3-recommended", "prettier", ], rules: { // 和 $ref let 冲突, fixed vue@3.2.26 // "prefer-const": "off", "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/ban-ts-comment": "off", "@typescript-eslint/no-unsafe-assignment": "off", "@typescript-eslint/no-unsafe-member-access": "off", "@typescript-eslint/restrict-plus-operands": "off", "@typescript-eslint/restrict-template-expressions": "off", "@typescript-eslint/no-non-null-assertion": "off", "@typescript-eslint/no-unsafe-call": "off", "@typescript-eslint/no-unsafe-return": "off", "@typescript-eslint/no-unsafe-argument": "off", // 一处使用hypen和一处不使用hypen,让字符搜索变得困难 "vue/attribute-hyphenation": ["error", "never"], "vue/v-on-event-hyphenation": ["error", "never", { autofix: true }], "vue/no-v-html": "off", // TODO: https://github.com/vuejs/rfcs/discussions/369 defineProps deconstructure retain reactivity // eslint-disable-next-line vue/no-setup-props-destructure "vue/no-setup-props-destructure": "off", "vue/multi-word-component-names": "off", "vue/no-unsafe-call": "off", "vue/no-unsafe-return": "off", "vue/no-unsafe-argument": "off", }, ignorePatterns: [ ".eslintrc.js", "vite.config.ts", "src/test", "prebuild.mjs", ], overrides: [ { files: ["src/**/**.vue"], parser: "vue-eslint-parser", parserOptions: { parser: { // Script parser for `