.eslintrc.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // @ts-check
  2. const { defineConfig } = require("eslint-define-config");
  3. module.exports = defineConfig({
  4. root: true,
  5. env: {
  6. browser: true,
  7. node: true,
  8. es6: true,
  9. },
  10. parser: "vue-eslint-parser",
  11. parserOptions: {
  12. parser: "@typescript-eslint/parser",
  13. ecmaVersion: 2020,
  14. sourceType: "module",
  15. jsxPragma: "React",
  16. ecmaFeatures: {
  17. jsx: true,
  18. },
  19. },
  20. extends: [
  21. "plugin:vue/vue3-recommended",
  22. "plugin:@typescript-eslint/recommended",
  23. "prettier",
  24. "plugin:prettier/recommended",
  25. "plugin:jest/recommended",
  26. ],
  27. rules: {
  28. "vue/script-setup-uses-vars": "error",
  29. "@typescript-eslint/ban-ts-ignore": "off",
  30. "@typescript-eslint/explicit-function-return-type": "off",
  31. "@typescript-eslint/no-explicit-any": "off",
  32. "@typescript-eslint/no-var-requires": "off",
  33. "@typescript-eslint/no-empty-function": "off",
  34. "vue/custom-event-name-casing": "off",
  35. "no-use-before-define": "off",
  36. "@typescript-eslint/no-use-before-define": "off",
  37. "@typescript-eslint/ban-ts-comment": "off",
  38. "@typescript-eslint/ban-types": "off",
  39. "@typescript-eslint/no-non-null-assertion": "off",
  40. "@typescript-eslint/explicit-module-boundary-types": "off",
  41. "@typescript-eslint/no-unused-vars": [
  42. "error",
  43. {
  44. argsIgnorePattern: "^_",
  45. varsIgnorePattern: "^_",
  46. },
  47. ],
  48. "no-unused-vars": [
  49. "error",
  50. {
  51. argsIgnorePattern: "^_",
  52. varsIgnorePattern: "^_",
  53. },
  54. ],
  55. "space-before-function-paren": "off",
  56. "vue/attributes-order": "off",
  57. "vue/one-component-per-file": "off",
  58. "vue/html-closing-bracket-newline": "off",
  59. "vue/max-attributes-per-line": "off",
  60. "vue/multiline-html-element-content-newline": "off",
  61. "vue/singleline-html-element-content-newline": "off",
  62. "vue/attribute-hyphenation": "off",
  63. "vue/require-default-prop": "off",
  64. "vue/require-explicit-emits": "off",
  65. "vue/no-useless-template-attributes": "off",
  66. "vue/html-self-closing": [
  67. "error",
  68. {
  69. html: {
  70. void: "always",
  71. normal: "never",
  72. component: "always",
  73. },
  74. svg: "always",
  75. math: "always",
  76. },
  77. ],
  78. "vue/multi-word-component-names": "off",
  79. },
  80. });