.eslintrc.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. module.exports = {
  2. root: true,
  3. env: {
  4. node: true,
  5. },
  6. extends: [
  7. 'plugin:vue/essential',
  8. '@vue/standard',
  9. ],
  10. parserOptions: {
  11. parser: 'babel-eslint',
  12. },
  13. rules: {
  14. 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
  15. 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
  16. 'comma-dangle': ['error', 'always-multiline'],
  17. camelcase: process.env.NODE_ENV === 'production' ? 'error' : 'off',
  18. 'import/order': ['warn', {
  19. groups: ['builtin', 'external', ['internal', 'sibling', 'parent'], 'index'],
  20. }],
  21. 'vue/html-closing-bracket-newline': ['error', {
  22. multiline: 'never',
  23. }],
  24. 'vue/html-closing-bracket-spacing': ['error', {
  25. startTag: 'never',
  26. endTag: 'never',
  27. selfClosingTag: 'always',
  28. }],
  29. 'vue/component-name-in-template-casing': ['error', 'kebab-case'],
  30. 'vue/html-quotes': ['error', 'double'],
  31. 'vue/html-self-closing': ['error', {
  32. html: {
  33. void: 'always',
  34. normal: 'always',
  35. component: 'always',
  36. },
  37. svg: 'always',
  38. math: 'always',
  39. }],
  40. 'vue/order-in-components': ['error', {
  41. order: [
  42. 'el',
  43. 'name',
  44. 'parent',
  45. 'functional',
  46. ['delimiters', 'comments'],
  47. ['components', 'directives', 'filters'],
  48. 'extends',
  49. 'mixins',
  50. 'inheritAttrs',
  51. 'model',
  52. ['props', 'propsData'],
  53. 'data',
  54. 'computed',
  55. 'watch',
  56. 'LIFECYCLE_HOOKS',
  57. 'methods',
  58. ['template', 'render'],
  59. 'renderError',
  60. ],
  61. }],
  62. 'no-useless-catch': 0,
  63. 'no-prototype-builtins': 0,
  64. },
  65. overrides: [
  66. {
  67. files: [
  68. '**/__tests__/*.{j,t}s?(x)',
  69. '**/tests/unit/**/*.spec.{j,t}s?(x)',
  70. ],
  71. env: {
  72. jest: true,
  73. },
  74. },
  75. ],
  76. }