您的位置:首页 > 其它

ESLint语法检测配置说明

2018-03-11 21:25 621 查看

ESLint语法检测配置说明

常用配置及其相关说明

module.exports = {
root: true,
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module'
},
// https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style extends: 'standard',
// required to lint *.vue files
plugins: [
'html'
],
// add your custom rules here
'rules': {
//箭头函数用小括号括起来
'arrow-parens': 0,
//生成器函数*的前后空格
'generator-star-spacing': 0,
//如果为2表示禁止使用debugger
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
//语句强制分号结尾
'semi': ['error', 'always'],
//缩进风格
'indent': 0,
//函数定义时括号前面要不要有空格
'space-before-function-paren': 0,
//注释风格要不要有空格什么的
'spaced-comment': 0,
//函数定义时括号前面要不要有空格
'space-before-blocks' : [0, 'always']
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: