eslint老是各种警告报错,根据个人习惯总结的各种兼容,以备自用
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/essential',
'eslint:recommended'
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
"no-unused-vars":"off",//避免声明的变量没有用到而报警告
"indent": ["error", 2],// 嵌套的代码块或者语句需要具有一定的缩进
'space-before-function-paren': 0,//eslint报错:Missing space before function parentheses space-before-function-paren...
'no-mixed-spaces-and-tabs': 0,//Vue报错:Mixed spaces and tabs no-mixed-spaces-and-tabs
'indent': 'off',//关闭缩进
"no-irregular-whitespace":"off"//这禁止掉 空格报错检查Irregular whitespace not allowed
},
globals: {//针对使用vue-amap中报错 AMAP is not defined
'AMap': false,
AMapUI: false
},
parserOptions: {
parser: 'babel-eslint'
}
}