blank-vue-template/eslint.config.js

57 lines
1.5 KiB
JavaScript
Raw Normal View History

2025-10-22 11:23:09 +08:00
import antfu from "@antfu/eslint-config";
export default antfu({
formatters: {
html: false,
css: true,
},
test: false,
typescript: false,
vue: true,
stylistic: {
semi: true,
quotes: "double",
},
overrides: {
vue: {
"vue/no-template-shadow": "error",
"vue/attribute-hyphenation": "error",
"vue/html-end-tags": "error",
"vue/component-name-in-template-casing": ["error", "kebab-case"],
"vue/enforce-style-attribute": [
"error",
{ allow: ["scoped", "module"] },
],
"vue/v-on-event-hyphenation": [
"error",
"always",
{
autofix: true,
},
],
"vue/require-explicit-emits": "error",
},
javascript: {
"no-console": process.env.NODE_ENV === "production" ? "error" : "warn",
"no-debugger": process.env.NODE_ENV === "production" ? "error" : "warn",
"no-alert": process.env.NODE_ENV === "production" ? "error" : "warn",
"no-restricted-syntax": [
"error",
{
selector: "VariableDeclarator[id.name='pd']",
message: "不允许使用 pd请改用有语义化的变量名",
},
{
selector: "ObjectExpression > Property[key.name='pd']",
message: "不允许使用 pd请改用有语义化的变量名",
},
],
},
},
rules: {
"antfu/top-level-function": "off",
"node/prefer-global/process": "off",
"linebreak-style": ["off", "windows"],
},
});