You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

120 lines
2.6 KiB

  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. };