.eslintrc.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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/html-self-closing': [
  65. 'error',
  66. {
  67. html: {
  68. void: 'always',
  69. normal: 'never',
  70. component: 'always',
  71. },
  72. svg: 'always',
  73. math: 'always',
  74. },
  75. ],
  76. },
  77. });