eslint

module.exports = {
  root: true,
  env: {
    node: true
  },
  'extends': [
    'plugin:vue/essential',
    '@vue/standard'
  ],
  rules: {
    'no-console': 0,
    // 在块级作用域外访问块内定义的变量是否报错提示
    "block-scoped-var": 2,
    // 控制逗号前后的空格
    "comma-spacing": [2, { "before": false, "after": true }],
    // 使用 === 替代 ==
    "eqeqeq": 2, // 必须使用全等
    "no-var": 2, // 禁用var,用let和const代替
    "no-undef": 2, // 不能有未定义的变量
    "semi": [2, "never"], // 不使用分号结尾
    "indent": "off", // 显示缩进为2
  },
  parserOptions: {
    parser: 'babel-eslint'
  }
}

  

原文地址:https://www.cnblogs.com/guangzhou11/p/12463287.html