.eslintrc.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. module.exports = {
  2. root: true,
  3. env: {
  4. node: true,
  5. browser: true,
  6. es6: true
  7. },
  8. extends: ['plugin:vue/essential', 'eslint:recommended', '@vue/standard', 'prettier'],
  9. rules: {
  10. 'vue/no-parsing-error': [2, {
  11. "x-invalid-end-tag": false,
  12. "invalid-first-character-of-tag-name": false
  13. }],
  14. 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  15. 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
  16. // 不强制使用一致的换行风格
  17. 'linebreak-style': 0,
  18. // 不禁用嵌套的三元表达式
  19. 'no-nested-ternary': 0,
  20. // 不强制在 parseInt() 使用基数参数
  21. radix: 0,
  22. // 不要求 require() 出现在顶层模块作用域中
  23. 'global-require': 0,
  24. // 不强制一行的最大长度
  25. 'max-len': 0,
  26. // 不禁止对function的参数进行重新赋值
  27. 'no-param-reassign': 0,
  28. // 不禁用一元操作将++和--
  29. 'no-plusplus': 0,
  30. // 允许使用模板字面量而非字符串连接
  31. 'prefer-template': 0,
  32. // 允许出现未使用过的表达式
  33. 'no-unused-expressions ': 0,
  34. // 允许变量声明与外层作用域的变量同名
  35. 'no-shadow': 0,
  36. 'import/no-unresolved': 0,
  37. 'import/no-dynamic-require': 0,
  38. 'import/extensions': 0,
  39. 'no-mixed-operators': 0,
  40. 'no-extraneous-dependencies': 0,
  41. 'prefer-default-export': 0,
  42. 'comma-dangle': 2,
  43. semi: 0,
  44. 'import/no-extraneous-dependencies': 0
  45. },
  46. parserOptions: {
  47. parser: 'babel-eslint',
  48. sourceType: 'module'
  49. },
  50. overrides: [{
  51. files: ['**/__tests__/*.{j,t}s?(x)', '**/tests/unit/**/*.spec.{j,t}s?(x)'],
  52. env: {
  53. jest: true
  54. }
  55. }]
  56. };