.eslintrc.cjs 2.7 KB

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