.eslintrc.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. module.exports = {
  2. root: true,
  3. env: {
  4. node: true,
  5. browser: true,
  6. 'vue/setup-compiler-macros': true,
  7. },
  8. extends: [
  9. 'vue-global-api',
  10. 'eslint:recommended',
  11. 'plugin:vue/vue3-recommended',
  12. '@vue/eslint-config-typescript/recommended',
  13. 'plugin:prettier/recommended',
  14. '@vue/eslint-config-prettier',
  15. '@element-plus/eslint-config',
  16. 'plugin:unicorn/recommended',
  17. ],
  18. globals: {
  19. defineOptions: 'writable',
  20. },
  21. parser: 'vue-eslint-parser',
  22. parserOptions: {
  23. parser: '@typescript-eslint/parser',
  24. sourceType: 'module',
  25. ecmaVersion: 2020,
  26. },
  27. rules: {
  28. '@typescript-eslint/ban-ts-comment': 'off',
  29. '@typescript-eslint/no-empty-function': 'off',
  30. '@typescript-eslint/no-explicit-any': 'off',
  31. '@typescript-eslint/no-non-null-assertion': 'off',
  32. '@typescript-eslint/no-this-alias': 'off',
  33. 'array-callback-return': 'off',
  34. 'escape-case': 'off',
  35. 'eslint-comments/no-unlimited-disable': 'off',
  36. 'import/order': 'off',
  37. 'no-alert': 'off',
  38. 'no-console': 'off',
  39. 'no-debugger': 'off',
  40. 'no-restricted-imports': 'off',
  41. 'no-return-await': 'off',
  42. 'prefer-const': 'off',
  43. 'prefer-template': 'error',
  44. 'prettier/prettier': 'error',
  45. 'unicorn/consistent-function-scoping': 'off',
  46. 'unicorn/escape-case': 'off',
  47. 'unicorn/filename-case': 'off',
  48. 'unicorn/import-style': 'off',
  49. 'unicorn/no-abusive-eslint-disable': 'off',
  50. 'unicorn/no-array-callback-reference': 'off',
  51. 'unicorn/no-array-for-each': 'off',
  52. 'unicorn/no-array-reduce': 'off',
  53. 'unicorn/no-nested-ternary': 'off',
  54. 'unicorn/no-null': 'off',
  55. 'unicorn/no-object-as-default-parameter': 'off',
  56. 'unicorn/no-process-exit': 'off',
  57. 'unicorn/no-this-assignment': 'off',
  58. 'unicorn/numeric-separators-style': 'off',
  59. 'unicorn/prefer-array-some': 'off',
  60. 'unicorn/prefer-default-parameters': 'off',
  61. 'unicorn/prefer-dom-node-append': 'off',
  62. 'unicorn/prefer-dom-node-remove': 'off',
  63. 'unicorn/prefer-logical-operator-over-ternary': 'off',
  64. 'unicorn/prefer-math-trunc': 'off',
  65. 'unicorn/prefer-module': 'off',
  66. 'unicorn/prefer-number-properties': 'off',
  67. 'unicorn/prefer-query-selector': 'off',
  68. 'unicorn/prefer-spread': 'off',
  69. 'unicorn/prefer-string-slice': 'off',
  70. 'unicorn/prefer-structured-clone': 'off',
  71. 'unicorn/prefer-ternary': 'off',
  72. 'unicorn/prefer-top-level-await': 'off',
  73. 'unicorn/prevent-abbreviations': 'off',
  74. 'vue/multi-word-component-names': 'off',
  75. 'vue/no-reserved-component-names': 'off',
  76. 'vue/no-setup-props-destructure': 'off',
  77. 'vue/no-v-html': 'off',
  78. 'vue/require-default-prop': 'off',
  79. camelcase: 'off',
  80. 'vue/attributes-order': [
  81. 'warn',
  82. {
  83. alphabetical: true,
  84. },
  85. ],
  86. 'vue/component-name-in-template-casing': [
  87. 'error',
  88. 'kebab-case',
  89. {
  90. registeredComponentsOnly: false,
  91. ignores: [],
  92. },
  93. ],
  94. 'vue/html-self-closing': [
  95. 'error',
  96. {
  97. html: {
  98. void: 'any',
  99. normal: 'any',
  100. component: 'always',
  101. },
  102. svg: 'always',
  103. math: 'always',
  104. },
  105. ],
  106. 'vue/v-on-event-hyphenation': [
  107. 'error',
  108. 'always',
  109. {
  110. autofix: true,
  111. },
  112. ],
  113. },
  114. }