eslint的运用小技能

1.运用划定规矩

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

2.封闭划定规矩

1.疏忽缩进: 封闭tab和space形成的indent 缩进毛病提醒

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': {
    'indent': 0 // 疏忽indent
  }
}

2.毛病提醒

1.Value must be omitted for boolean attributes

示意 默许 属性是true 不需要设置 xxx={true}

    原文作者:spademan
    原文地址: https://segmentfault.com/a/1190000007628500
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞