.eslintrc.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. 'generator-star-spacing': 'off',
  18. 'no-mixed-operators': 0,
  19. "vue/max-attributes-per-line": [2, {
  20. "singleline": 10,
  21. "multiline": {
  22. "max": 1,
  23. "allowFirstLine": false
  24. }
  25. }],
  26. 'vue/attribute-hyphenation': 0,
  27. 'vue/html-self-closing': 0,
  28. 'vue/component-name-in-template-casing': 0,
  29. 'vue/html-closing-bracket-spacing': 0,
  30. 'vue/singleline-html-element-content-newline': 0,
  31. 'vue/no-unused-components': 0,
  32. 'vue/multiline-html-element-content-newline': 0,
  33. 'vue/no-use-v-if-with-v-for': 0,
  34. 'vue/html-closing-bracket-newline': 0,
  35. 'vue/no-parsing-error': 0,
  36. 'no-tabs': 0,
  37. 'quotes': 0,
  38. 'semi': 0,
  39. 'no-delete-var': 2,
  40. 'prefer-const': 0,
  41. 'template-curly-spacing': 'off',
  42. //'indent': 'off',
  43. 'indent': ["off", 2]
  44. },
  45. overrides: [
  46. {
  47. files: [
  48. '**/__tests__/*.{j,t}s?(x)',
  49. '**/tests/unit/**/*.spec.{j,t}s?(x)'
  50. ],
  51. env: {
  52. jest: true
  53. }
  54. }
  55. ]
  56. }