在vue根目录中的 .eslintrc.js 文件中配置
module.exports = {
root: true,
env: {
node: true
},
extends: ['plugin:vue/essential', '@vue/standard'],
parserOptions: {
parser: '@babel/eslint-parser'
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'space-before-function-paren': 0, //关闭这个函数括号前必须加空格的检测
}
}
在.prettierrc中配置
{
"semi": false, //不使用分号
"useTabs": false, // 不使用tab缩进
"tabWidth": 2, // tab缩进大小,默认为2
"singleQuote": true, //使用单引号
"trailingComma": "none" //结束不加逗号
}