.eslintrc.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. "../eslint.base.cjs",
  35. "plugin:vue/vue3-essential",
  36. "eslint:recommended",
  37. "@vue/typescript/recommended",
  38. "@vue/prettier",
  39. "@vue/eslint-config-typescript"
  40. ],
  41. parser: "vue-eslint-parser",
  42. parserOptions: {
  43. parser: "@typescript-eslint/parser",
  44. ecmaVersion: 2020,
  45. sourceType: "module",
  46. jsxPragma: "React",
  47. ecmaFeatures: {
  48. jsx: true
  49. }
  50. },
  51. overrides: [
  52. {
  53. files: ["*.ts", "*.vue"],
  54. rules: {
  55. "no-undef": "off"
  56. }
  57. },
  58. {
  59. files: ["*.vue"],
  60. parser: "vue-eslint-parser",
  61. parserOptions: {
  62. parser: "@typescript-eslint/parser",
  63. extraFileExtensions: [".vue"],
  64. ecmaVersion: "latest",
  65. ecmaFeatures: {
  66. jsx: true
  67. }
  68. },
  69. rules: {
  70. "no-undef": "off"
  71. }
  72. }
  73. ],
  74. rules: {
  75. "vue/no-v-html": "off",
  76. "vue/require-default-prop": "off",
  77. "vue/require-explicit-emits": "off",
  78. "vue/multi-word-component-names": "off",
  79. "@typescript-eslint/no-explicit-any": "off", // any
  80. "no-debugger": "off",
  81. "@typescript-eslint/explicit-module-boundary-types": "off", // setup()
  82. "@typescript-eslint/ban-types": "off",
  83. "@typescript-eslint/ban-ts-comment": "off",
  84. "@typescript-eslint/no-empty-function": "off",
  85. "@typescript-eslint/no-non-null-assertion": "off",
  86. "vue/html-self-closing": [
  87. "error",
  88. {
  89. html: {
  90. void: "always",
  91. normal: "always",
  92. component: "always"
  93. },
  94. svg: "always",
  95. math: "always"
  96. }
  97. ],
  98. "@typescript-eslint/no-unused-vars": [
  99. "error",
  100. {
  101. argsIgnorePattern: "^_",
  102. varsIgnorePattern: "^_"
  103. }
  104. ],
  105. "no-unused-vars": [
  106. "error",
  107. {
  108. argsIgnorePattern: "^_",
  109. varsIgnorePattern: "^_"
  110. }
  111. ],
  112. "prettier/prettier": [
  113. "error",
  114. {
  115. endOfLine: "auto"
  116. }
  117. ]
  118. }
  119. };