12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- /**
- * @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", ".config.js"],
- },
- plugins: ["@typescript-eslint"],
- extends: [
- "eslint:recommended",
- "plugin:@typescript-eslint/recommended",
- "plugin:@typescript-eslint/recommended-requiring-type-checking",
- "plugin:vue/vue3-recommended",
- "prettier",
- "./.eslintrc-auto-import.json",
- ],
- rules: {
- "@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",
- // 一处使用hypen和一处不使用hypen,让字符搜索变得困难
- "vue/attribute-hyphenation": ["error", "never"],
- "vue/v-on-event-hyphenation": ["error", "never", { autofix: true }],
- "vue/no-v-html": "off",
- },
- ignorePatterns: [
- ".eslintrc.js",
- "vite.config.ts",
- "vitest.config.ts",
- "src/test",
- "test",
- "prebuild.mjs",
- ],
- overrides: [
- {
- files: ["src/**/**.vue"],
- parser: "vue-eslint-parser",
- parserOptions: {
- parser: {
- // Script parser for `<script>`
- js: "espree",
- // Script parser for `<script lang="ts">`
- ts: "@typescript-eslint/parser",
- // Script parser for vue directives (e.g. `v-if=` or `:attribute=`)
- // and vue interpolations (e.g. `{{variable}}`).
- // If not specified, the parser determined by `<script lang ="...">` is used.
- "<template>": "espree",
- },
- project: ["tsconfig.json"],
- },
- globals: {
- $ref: true,
- $computed: true,
- $$: true,
- $message: true,
- $dialog: true,
- _hmt: true,
- },
- },
- ],
- };
|