.eslintrc.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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/prettier/@typescript-eslint',
  39. 'plugin:prettier/recommended',
  40. "@vue/eslint-config-typescript",
  41. ],
  42. parser: "vue-eslint-parser",
  43. parserOptions: {
  44. parser: "@typescript-eslint/parser",
  45. ecmaVersion: 2020,
  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. };