module.exports = {
root: true,
env: {
node: true
},
extends: [
"plugin:vue/essential",
"eslint:recommended",
"@vue/typescript/recommended"
// "@vue/prettier",
// "@vue/prettier/@typescript-eslint"
],
parserOptions: {
ecmaVersion: 2020
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'@typescript-eslint/no-explicit-any': ['off'], // 关闭any类型时的警告
'@typescript-eslint/no-empty-function': ['off'], // 关闭空函数警告
"@typescript-eslint/no-var-requires": [0],
"@typescript-eslint/camelcase": ["off"], // 关闭词组下划线校验
"@typescript-eslint/ban-ts-ignore": ["off"], // 允许使用ts-ignore
'vue/max-attributes-per-line': [2, {
'singleline': 10,
'multiline': {
'max': 1,
'allowFirstLine': false
}
}],
'vue/html-self-closing': [2, {
'html': {
'void': 'any',
'normal': 'any',
'component': 'any'
},
'svg': 'always',
'math': 'always'
}],
'vue/name-property-casing': ['error', 'PascalCase'],
'accessor-pairs': 2, // 强制 getter 和 setter 在对象中成对出现
'arrow-spacing': [2, {
'before': true,
'after': true
}], // 强制箭头函数的箭头前后使用一致的空格
'block-spacing': [2, 'always'], // 禁止或强制在代码块中开括号前和闭括号后有空格
'brace-style': [2, '1tbs', {
'allowSingleLine': true
}], // 强制在代码块中使用一致的大括号风格
'camelcase': [0, {
'properties': 'always'
}]
Eslint的默认配置
最新推荐文章于 2025-11-06 14:12:16 发布

最低0.47元/天 解锁文章
1488

被折叠的 条评论
为什么被折叠?



