.eslintrc.js 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. module.exports = {
  2. root: true,
  3. env: {
  4. node: true
  5. },
  6. 'extends': [
  7. 'plugin:vue/strongly-recommended',
  8. '@vue/standard'
  9. ],
  10. rules: {
  11. 'no-console': 'off',
  12. 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  13. 'generator-star-spacing': 'off',
  14. 'no-mixed-operators': 0,
  15. 'vue/max-attributes-per-line': [
  16. 2,
  17. {
  18. 'singleline': 5,
  19. 'multiline': {
  20. 'max': 1,
  21. 'allowFirstLine': false
  22. }
  23. }
  24. ],
  25. 'vue/attribute-hyphenation': 0,
  26. 'vue/html-self-closing': 0,
  27. 'vue/component-name-in-template-casing': 0,
  28. 'vue/html-closing-bracket-spacing': 0,
  29. 'vue/singleline-html-element-content-newline': 0,
  30. 'vue/no-unused-components': 0,
  31. 'vue/multiline-html-element-content-newline': 0,
  32. 'vue/no-use-v-if-with-v-for': 0,
  33. 'vue/html-closing-bracket-newline': 0,
  34. 'vue/no-parsing-error': 0,
  35. 'no-tabs': 0,
  36. 'quotes': [
  37. 2,
  38. 'single',
  39. {
  40. 'avoidEscape': true,
  41. 'allowTemplateLiterals': true
  42. }
  43. ],
  44. 'semi': [
  45. 2,
  46. 'never',
  47. {
  48. 'beforeStatementContinuationChars': 'never'
  49. }
  50. ],
  51. 'no-delete-var': 2,
  52. 'prefer-const': [
  53. 2,
  54. {
  55. 'ignoreReadBeforeAssign': false
  56. }
  57. ],
  58. 'template-curly-spacing': 'off',
  59. 'indent': 'off'
  60. },
  61. parserOptions: {
  62. parser: 'babel-eslint'
  63. },
  64. overrides: [
  65. {
  66. files: [
  67. '**/__tests__/*.{j,t}s?(x)',
  68. '**/tests/unit/**/*.spec.{j,t}s?(x)'
  69. ],
  70. env: {
  71. jest: true
  72. }
  73. }
  74. ],
  75. "globals": {
  76. "hasPerm": true //xxxx -> 报错的变量
  77. }
  78. }