.eslintrc_20220601114517.js 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. module.exports = {
  2. root: true,
  3. parser: 'babel-eslint',
  4. parserOptions: {
  5. //设置"script"(默认)或"module"如果你的代码是在ECMAScript中的模块。
  6. sourceType: 'module'
  7. },
  8. env: {
  9. browser: true,
  10. },
  11. // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
  12. extends: 'standard',
  13. // required to lint *.vue files
  14. plugins: [
  15. 'html'
  16. ],
  17. // add your custom rules here
  18. 'rules': {
  19. // allow paren-less arrow functions
  20. 'arrow-parens': 0,
  21. // allow async-await
  22. 'generator-star-spacing': 0,
  23. // allow debugger during development
  24. 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
  25. "no-unused-vars": [2, {
  26. // 允许声明未使用变量
  27. "vars": "local",
  28. // 参数不检查
  29. "args": "none"
  30. }],
  31. // 关闭语句强制分号结尾
  32. "semi": [0],
  33. //key值前面是否要有空格
  34. "key-spacing": [0, {
  35. "singleLine": {
  36. "beforeColon": false,
  37. "afterColon": true
  38. },
  39. "multiLine": {
  40. "beforeColon": true,
  41. "afterColon": true,
  42. "align": "colon"
  43. },
  44. //空行最多不能超过100行
  45. "no-multiple-empty-lines": [0, { "max": 100 }],
  46. //关闭禁止混用tab和空格
  47. "no-mixed-spaces-and-tabs": [0],
  48. //数组第一个指定是否启用这个规则,第二个指定几个空格
  49. "indent": [1, 2],
  50. }]
  51. },
  52. }