.eslintrc.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. module.exports = {
  2. root: true,
  3. env: {
  4. node: true
  5. },
  6. globals: {
  7. // Ref sugar (take 2)
  8. $: "readonly",
  9. $$: "readonly",
  10. $ref: "readonly",
  11. $shallowRef: "readonly",
  12. $computed: "readonly",
  13. // index.d.ts
  14. // global.d.ts
  15. Fn: "readonly",
  16. PromiseFn: "readonly",
  17. RefType: "readonly",
  18. LabelValueOptions: "readonly",
  19. EmitType: "readonly",
  20. TargetContext: "readonly",
  21. ComponentElRef: "readonly",
  22. ComponentRef: "readonly",
  23. ElRef: "readonly",
  24. global: "readonly",
  25. ForDataType: "readonly",
  26. ComponentRoutes: "readonly",
  27. // script setup
  28. defineProps: "readonly",
  29. defineEmits: "readonly",
  30. defineExpose: "readonly",
  31. withDefaults: "readonly"
  32. },
  33. extends: [
  34. "plugin:vue/vue3-essential",
  35. "eslint:recommended",
  36. "@vue/typescript/recommended",
  37. "@vue/prettier",
  38. "@vue/eslint-config-typescript"
  39. ],
  40. parser: "vue-eslint-parser",
  41. parserOptions: {
  42. parser: "@typescript-eslint/parser",
  43. ecmaVersion: 2020,
  44. sourceType: "module",
  45. jsxPragma: "React",
  46. ecmaFeatures: {
  47. jsx: true
  48. }
  49. },
  50. overrides: [
  51. {
  52. files: ["*.ts", "*.vue"],
  53. rules: {
  54. "no-undef": "off"
  55. }
  56. },
  57. {
  58. files: ["*.vue"],
  59. parser: "vue-eslint-parser",
  60. parserOptions: {
  61. parser: "@typescript-eslint/parser",
  62. extraFileExtensions: [".vue"],
  63. ecmaVersion: "latest",
  64. ecmaFeatures: {
  65. jsx: true
  66. }
  67. },
  68. rules: {
  69. "no-undef": "off"
  70. }
  71. }
  72. ],
  73. rules: {
  74. "vue/no-v-html": "off",
  75. "vue/require-default-prop": "off",
  76. "vue/require-explicit-emits": "off",
  77. "vue/multi-word-component-names": "off",
  78. "@typescript-eslint/no-explicit-any": "off", // any
  79. "no-debugger": "off",
  80. "@typescript-eslint/explicit-module-boundary-types": "off", // setup()
  81. "@typescript-eslint/ban-types": "off",
  82. "@typescript-eslint/ban-ts-comment": "off",
  83. "@typescript-eslint/no-empty-function": "off",
  84. "@typescript-eslint/no-non-null-assertion": "off",
  85. "vue/html-self-closing": [
  86. "error",
  87. {
  88. html: {
  89. void: "always",
  90. normal: "always",
  91. component: "always"
  92. },
  93. svg: "always",
  94. math: "always"
  95. }
  96. ],
  97. "@typescript-eslint/no-unused-vars": [
  98. "error",
  99. {
  100. argsIgnorePattern: "^_",
  101. varsIgnorePattern: "^_"
  102. }
  103. ],
  104. "no-unused-vars": [
  105. "error",
  106. {
  107. argsIgnorePattern: "^_",
  108. varsIgnorePattern: "^_"
  109. }
  110. ],
  111. "prettier/prettier": [
  112. "error",
  113. {
  114. endOfLine: "auto"
  115. }
  116. ]
  117. }
  118. };