43 lines
1002 B
JavaScript
43 lines
1002 B
JavaScript
|
|
import antfu from "@antfu/eslint-config";
|
|||
|
|
|
|||
|
|
export default antfu({
|
|||
|
|
formatters: {
|
|||
|
|
html: false,
|
|||
|
|
css: true,
|
|||
|
|
},
|
|||
|
|
test: false,
|
|||
|
|
typescript: true,
|
|||
|
|
react: false,
|
|||
|
|
vue: false,
|
|||
|
|
markdown: false,
|
|||
|
|
stylistic: {
|
|||
|
|
semi: true,
|
|||
|
|
quotes: "double",
|
|||
|
|
},
|
|||
|
|
overrides: {
|
|||
|
|
javascript: {
|
|||
|
|
"no-console": ["warn", { allow: ["warn", "error"] }],
|
|||
|
|
"no-debugger": "error",
|
|||
|
|
"no-alert": "error",
|
|||
|
|
"no-restricted-syntax": [
|
|||
|
|
"error",
|
|||
|
|
{
|
|||
|
|
selector: "VariableDeclarator[id.name='pd']",
|
|||
|
|
message: "不允许使用 pd,请改用有语义化的变量名",
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
selector: "ObjectExpression > Property[key.name='pd']",
|
|||
|
|
message: "不允许使用 pd,请改用有语义化的变量名",
|
|||
|
|
},
|
|||
|
|
],
|
|||
|
|
"no-unused-vars": "error",
|
|||
|
|
},
|
|||
|
|
},
|
|||
|
|
rules: {
|
|||
|
|
"antfu/top-level-function": "off",
|
|||
|
|
"node/prefer-global/process": "off",
|
|||
|
|
"dot-notation": "off",
|
|||
|
|
"linebreak-style": ["off", "windows"],
|
|||
|
|
},
|
|||
|
|
});
|