// 预定义的全局变量,这里是浏览器环境
browser: true,
},
// 扩展一个流行的风格指南,即 eslint-config-standard
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
extends: ‘standard’,
// required to lint *.vue files
plugins: [
// 此插件用来识别.html 和 .vue文件中的js代码
‘html’,
// standard风格的依赖包
“standard”,
// standard风格的依赖包
“promise”
],
// add your custom rules here
‘rules’: {
// allow paren-less arrow functions
‘arrow-parens’: 0,
// allow async-await
‘generator-star-spacing’: 0,
// allow debugger during development
‘no-debugger’: process.env.NODE_ENV === ‘production’ ? 2 : 0
}
}
3.安装配置文件中依赖包:
-
eslint
-
babel-eslint
-
eslint-plugin-html
-
eslint-config-standard
-
eslint-plugin-stand