.eslintrc.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. module.exports = {
  2. root: true,
  3. parserOptions: {
  4. parser: 'babel-eslint',
  5. sourceType: 'module'
  6. },
  7. env: {
  8. browser: true,
  9. node: true,
  10. es6: true,
  11. },
  12. extends: ['plugin:vue/recommended', 'eslint:recommended'],
  13. rules: {
  14. 'no-console': 'off',
  15. "no-unused-vars":"off", //重要 var 变量为引入
  16. 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  17. "no-tabs":"off",
  18. 'generator-star-spacing': 'off',
  19. 'no-mixed-operators': 0,
  20. "vue/max-attributes-per-line": [2, {
  21. "singleline": 10,
  22. "multiline": {
  23. "max": 1,
  24. "allowFirstLine": false
  25. }
  26. }],
  27. 'vue/attribute-hyphenation': 0,
  28. 'vue/html-self-closing': 0,
  29. 'vue/component-name-in-template-casing': 0,
  30. 'vue/html-closing-bracket-spacing': 0,
  31. 'vue/singleline-html-element-content-newline': 0,
  32. 'vue/no-unused-components': 0,
  33. 'vue/multiline-html-element-content-newline': 0,
  34. 'vue/no-use-v-if-with-v-for': 0,
  35. 'vue/html-closing-bracket-newline': 0,
  36. 'vue/no-parsing-error': 0,
  37. 'no-tabs': 0,
  38. 'quotes': 0,
  39. 'semi': 0,
  40. 'no-delete-var': 2,
  41. 'prefer-const': 0,
  42. 'template-curly-spacing': 'off',
  43. //'indent': 'off',
  44. 'indent': ["off", 2]
  45. },
  46. overrides: [
  47. {
  48. files: [
  49. '**/__tests__/*.{j,t}s?(x)',
  50. '**/tests/unit/**/*.spec.{j,t}s?(x)'
  51. ],
  52. env: {
  53. jest: true
  54. }
  55. }
  56. ]
  57. }