eslint使用

一,使用规则

1.中文文档 http://eslint.cn/docs/rules/

二,关闭规则

对于不能使用tab,tab和空格不能混用,实在是抓狂。
以vue项目为例,在.eslintrc.js 文件下的rules下添加自己的修改
关闭对应的两个规则就好了

  // add your custom rules here
  rules: {
    // allow async-await
    'generator-star-spacing': 'off',
    // allow debugger during development
    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    //关闭禁止混用tab和空格
    "no-mixed-spaces-and-tabs": [0],
    "no-tabs": 'off'
  }

三,参考文章

1,摆脱令人抓狂的ESlint 语法检测配置说明
2,eslint的使用小技巧
3,vue.js程序启动运行时,遇到Unexpected tab character问题

猜你喜欢

转载自blog.csdn.net/superjunjin/article/details/80533475