Files
schoolNews/schoolNewsWeb/.eslintrc.cjs
2025-10-07 13:31:06 +08:00

44 lines
1.2 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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",
},
};