.eslintrc.js 2.7 KB

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