.eslintrc.cjs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. // reactivity transform
  26. "vue/no-setup-props-destructure": "off",
  27. "vue/component-tags-order": [
  28. "error",
  29. {
  30. order: ["script", "template", "style"],
  31. },
  32. ],
  33. "vue/block-tag-newline": [
  34. "error",
  35. {
  36. singleline: "always",
  37. multiline: "always",
  38. },
  39. ],
  40. "vue/component-name-in-template-casing": ["error", "PascalCase"],
  41. "vue/component-options-name-casing": ["error", "PascalCase"],
  42. "vue/custom-event-name-casing": ["error", "camelCase"],
  43. "vue/define-macros-order": [
  44. "error",
  45. {
  46. order: ["defineProps", "defineEmits"],
  47. },
  48. ],
  49. "vue/html-comment-content-spacing": [
  50. "error",
  51. "always",
  52. {
  53. exceptions: ["-"],
  54. },
  55. ],
  56. "vue/no-restricted-v-bind": ["error", "/^v-/"],
  57. "vue/no-useless-v-bind": "error",
  58. "vue/no-v-text-v-html-on-component": "error",
  59. "vue/padding-line-between-blocks": ["error", "always"],
  60. "vue/prefer-separate-static-class": "error",
  61. // extensions
  62. "vue/array-bracket-spacing": ["error", "never"],
  63. "vue/arrow-spacing": ["error", { before: true, after: true }],
  64. "vue/block-spacing": ["error", "always"],
  65. "vue/brace-style": ["error", "stroustrup", { allowSingleLine: true }],
  66. "vue/comma-dangle": ["error", "always-multiline"],
  67. "vue/comma-spacing": ["error", { before: false, after: true }],
  68. "vue/comma-style": ["error", "last"],
  69. "vue/dot-location": ["error", "property"],
  70. "vue/dot-notation": ["error", { allowKeywords: true }],
  71. "vue/eqeqeq": ["error", "smart"],
  72. // 'vue/func-call-spacing': ['off', 'never'],
  73. "vue/key-spacing": ["error", { beforeColon: false, afterColon: true }],
  74. "vue/keyword-spacing": ["error", { before: true, after: true }],
  75. "vue/no-constant-condition": "warn",
  76. "vue/no-empty-pattern": "error",
  77. "vue/no-extra-parens": ["error", "functions"],
  78. "vue/no-irregular-whitespace": "error",
  79. "vue/no-loss-of-precision": "error",
  80. "vue/no-restricted-syntax": [
  81. "error",
  82. "DebuggerStatement",
  83. "LabeledStatement",
  84. "WithStatement",
  85. ],
  86. "vue/no-sparse-arrays": "error",
  87. "vue/object-curly-newline": [
  88. "error",
  89. { multiline: true, consistent: true },
  90. ],
  91. "vue/object-curly-spacing": ["error", "always"],
  92. "vue/object-property-newline": [
  93. "error",
  94. { allowMultiplePropertiesPerLine: true },
  95. ],
  96. "vue/object-shorthand": [
  97. "error",
  98. "always",
  99. {
  100. ignoreConstructors: false,
  101. avoidQuotes: true,
  102. },
  103. ],
  104. "vue/operator-linebreak": ["error", "before"],
  105. "vue/prefer-template": "error",
  106. "vue/quote-props": ["error", "consistent-as-needed"],
  107. "vue/space-in-parens": ["error", "never"],
  108. "vue/space-infix-ops": "error",
  109. "vue/space-unary-ops": ["error", { words: true, nonwords: false }],
  110. "vue/template-curly-spacing": "error",
  111. "vue/no-reserved-component-names": "off"
  112. },
  113. };