.eslintrc.cjs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /* eslint-env node */
  2. require("@rushstack/eslint-patch/modern-module-resolution");
  3. module.exports = {
  4. root: true,
  5. env: {
  6. browser: true,
  7. node: true,
  8. },
  9. extends: [
  10. "plugin:vue/essential",
  11. "eslint:recommended"
  12. ],
  13. parser: "vue-eslint-parser",
  14. rules: {
  15. "semi": ["error", "never"],
  16. "no-unused-vars": "off",
  17. "no-undef": "off",
  18. "@typescript-eslint/no-unused-vars": "off",
  19. "vue/max-attributes-per-line": "off",
  20. "vue/no-v-html": "off",
  21. "vue/require-prop-types": "off",
  22. "vue/require-default-prop": "off",
  23. "vue/multi-word-component-names": "off",
  24. "vue/prefer-import-from-vue": "off",
  25. "no-debugger": "off",
  26. // reactivity transform
  27. "vue/no-setup-props-destructure": "off",
  28. "vue/component-tags-order": [
  29. "error",
  30. {
  31. order: ["script", "template", "style"],
  32. },
  33. ],
  34. "vue/block-tag-newline": [
  35. "error",
  36. {
  37. singleline: "always",
  38. multiline: "always",
  39. },
  40. ],
  41. "vue/component-name-in-template-casing": ["error", "PascalCase"],
  42. "vue/component-options-name-casing": ["error", "PascalCase"],
  43. "vue/custom-event-name-casing": ["error", "camelCase"],
  44. "vue/define-macros-order": [
  45. "error",
  46. {
  47. order: ["defineProps", "defineEmits"],
  48. },
  49. ],
  50. "vue/html-comment-content-spacing": [
  51. "error",
  52. "always",
  53. {
  54. exceptions: ["-"],
  55. },
  56. ],
  57. "vue/no-restricted-v-bind": ["error", "/^v-/"],
  58. "vue/no-useless-v-bind": "error",
  59. "vue/no-v-text-v-html-on-component": "error",
  60. "vue/padding-line-between-blocks": ["error", "always"],
  61. "vue/prefer-separate-static-class": "error",
  62. // extensions
  63. "vue/array-bracket-spacing": ["error", "never"],
  64. "vue/arrow-spacing": ["error", { before: true, after: true }],
  65. "vue/block-spacing": ["error", "always"],
  66. "vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
  67. "vue/comma-dangle": ["error", "always-multiline"],
  68. "vue/comma-spacing": ["error", { before: false, after: true }],
  69. "vue/comma-style": ["error", "last"],
  70. "vue/dot-location": ["error", "property"],
  71. "vue/dot-notation": ["error", { allowKeywords: true }],
  72. "vue/eqeqeq": ["error", "smart"],
  73. // 'vue/func-call-spacing': ['off', 'never'],
  74. "vue/key-spacing": ["error", { beforeColon: false, afterColon: true }],
  75. "vue/keyword-spacing": ["error", { before: true, after: true }],
  76. "vue/no-constant-condition": "warn",
  77. "vue/no-empty-pattern": "error",
  78. "vue/no-extra-parens": ["error", "functions"],
  79. "vue/no-irregular-whitespace": "error",
  80. "vue/no-loss-of-precision": "error",
  81. "vue/no-restricted-syntax": [
  82. "error",
  83. "DebuggerStatement",
  84. "LabeledStatement",
  85. "WithStatement",
  86. ],
  87. "vue/no-sparse-arrays": "error",
  88. "vue/object-curly-newline": [
  89. "error",
  90. { multiline: true, consistent: true },
  91. ],
  92. "vue/object-curly-spacing": ["error", "always"],
  93. "vue/object-property-newline": [
  94. "error",
  95. { allowMultiplePropertiesPerLine: true },
  96. ],
  97. "vue/object-shorthand": [
  98. "error",
  99. "always",
  100. {
  101. ignoreConstructors: false,
  102. avoidQuotes: true,
  103. },
  104. ],
  105. "vue/operator-linebreak": ["error", "before"],
  106. "vue/prefer-template": "error",
  107. "vue/quote-props": ["error", "consistent-as-needed"],
  108. "vue/space-in-parens": ["error", "never"],
  109. "vue/space-infix-ops": "error",
  110. "vue/space-unary-ops": ["error", { words: true, nonwords: false }],
  111. "vue/template-curly-spacing": "error",
  112. "vue/no-reserved-component-names": "off",
  113. "no-useless-escape": "off"
  114. },
  115. };