.eslintrc.js 1.83 KB
/*
 * @Author: jiangbotao
 * @Date: 2019-12-03 22:31:08
 * @LastEditors: jiangbotao
 * @LastEditTime: 2019-12-04 19:44:29
 * @FilePath: \superglobevue\.eslintrc.js
 */
module.exports = {
  root: true,
  env: {
    node: true
  },
  "globals": {
    "$": true,
    "e": true
  },
  'extends': [
    'plugin:vue/essential',
    '@vue/standard'
  ],
  rules: {
    'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    "indent": [0, 4], // 不理会tab缩进,默认缩进为4个空格
    "camelcase": 0,   // 不使用驼峰命名法
    "eol-last": 0,    // 最后一行不需要空格
    "no-console": 0,  // 允许console
    "space-infix-ops": [0, {"int32Hint": false}],   // 运算符周围不用空格
    "no-tabs": 0,
    "semi": [0, "never"],  //双引号
    "no-multiple-empty-lines": [0, { "max": 3 }],   // 最多允许空三行
    "no-trailing-spaces": [0, { "skipBlankLines": true , "ignoreComments": true}],
    "space-before-function-paren": ["error", "never"],
    "no-unused-vars": [0, { "vars": "all", "args": "none" }],  
    "key-spacing": [0, { "beforeColon": false, "afterColon": true }],
    "keyword-spacing": [0, { "before": false, "after": true }],
    "space-after-keywords": [0, "never"],
    "space-before-blocks": [0, { "functions": "never", "keywords": "never", "classes": "never" }],
    "spaced-comment": [0, "never"],
    "comma-dangle": [0, "always"],
    "quotes": [0, "double"],      //引号类型 `` "" ''
    "quote-props":[0, "always"]   //对象字面量中的属性名是否强制双引号
  },
  parserOptions: {
    parser: 'babel-eslint'
  },
  overrides: [
    {
      files: [
        '**/__tests__/*.{j,t}s?(x)',
        '**/tests/unit/**/*.spec.{j,t}s?(x)'
      ],
      env: {
        jest: true
      }
    }
  ]
}