44 lines
1.2 KiB
JavaScript
44 lines
1.2 KiB
JavaScript
|
|
module.exports = {
|
|||
|
|
root: true,
|
|||
|
|
env: {
|
|||
|
|
node: true,
|
|||
|
|
browser: true,
|
|||
|
|
es2021: true,
|
|||
|
|
},
|
|||
|
|
extends: [
|
|||
|
|
"plugin:vue/vue3-essential",
|
|||
|
|
"eslint:recommended",
|
|||
|
|
"@vue/typescript/recommended",
|
|||
|
|
],
|
|||
|
|
parserOptions: {
|
|||
|
|
ecmaVersion: 2020,
|
|||
|
|
sourceType: "module",
|
|||
|
|
},
|
|||
|
|
globals: {
|
|||
|
|
// Vue 3 编译宏
|
|||
|
|
defineProps: "readonly",
|
|||
|
|
defineEmits: "readonly",
|
|||
|
|
defineExpose: "readonly",
|
|||
|
|
withDefaults: "readonly",
|
|||
|
|
defineOptions: "readonly",
|
|||
|
|
// 其他全局变量
|
|||
|
|
process: "readonly",
|
|||
|
|
},
|
|||
|
|
rules: {
|
|||
|
|
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
|
|||
|
|
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
|
|||
|
|
// 允许单词组件名(如404、500等错误页面组件)
|
|||
|
|
"vue/multi-word-component-names": "off",
|
|||
|
|
// 允许未使用的变量(开发阶段常见)
|
|||
|
|
"@typescript-eslint/no-unused-vars": "warn",
|
|||
|
|
// 允许any类型(减少严格限制)
|
|||
|
|
"@typescript-eslint/no-explicit-any": "off",
|
|||
|
|
// 允许非空断言(!)
|
|||
|
|
"@typescript-eslint/no-non-null-assertion": "off",
|
|||
|
|
// 允许@ts-ignore注释
|
|||
|
|
"@typescript-eslint/ban-ts-comment": "off",
|
|||
|
|
// 允许未使用的导入
|
|||
|
|
"@typescript-eslint/no-unused-imports": "off",
|
|||
|
|
},
|
|||
|
|
};
|