.eslintrc.js 1.4 KB

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