module.exports = { extends: ['alloy', 'alloy/vue', 'alloy/typescript', 'plugin:@typescript-eslint/recommended'], parser: 'vue-eslint-parser', parserOptions: { parser: { js: '@babel/eslint-parser', jsx: '@babel/eslint-parser', ts: '@typescript-eslint/parser', tsx: '@typescript-eslint/parser', }, }, rules: { '@typescript-eslint/consistent-type-assertions': 'off', '@typescript-eslint/prefer-optional-chain': 'off', '@typescript-eslint/explicit-member-accessibility': 'off', '@typescript-eslint/no-non-null-assertion': 'off', '@typescript-eslint/no-explicit-any': 'off', '@typescript-eslint/no-unused-vars': 'off', '@typescript-eslint/no-empty-interface': 'off', 'no-return-assign': 'off', 'guard-for-in': 'off', 'vue/no-setup-props-destructure': 'off', 'vue/no-duplicate-attr-inheritance': 'off', 'no-eq-null': 'off', // 允许 == 用于 null 'vue/v-on-event-hyphenation': 'off', // 关闭 vue 中 @ 使用短横线命名 'no-duplicate-imports': 'off', // 使用ts-eslint的重复导入规则 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off', 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off', 'vue/multi-word-component-names': 'off', 'vue/no-duplicate-attributes': [ 'error', { allowCoexistClass: true, // 启用v-bind:class指令可以与普通class属性共存。默认值为true。 allowCoexistStyle: true, }, ], // 圈复杂度 每个函数的最高圈复杂度 complexity: [ 'error', { max: 12, }, ], }, globals: { defineProps: 'readonly', defineEmits: 'readonly', defineExpose: 'readonly', withDefaults: 'readonly', }, plugins: ['@typescript-eslint'], };