.eslintrc.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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: ['plugin:vue/vue3-recommended', 'plugin:@typescript-eslint/recommended', 'prettier', 'plugin:prettier/recommended', 'plugin:jest/recommended'],
  21. rules: {
  22. 'vue/script-setup-uses-vars': 'error',
  23. '@typescript-eslint/ban-ts-ignore': 'off',
  24. '@typescript-eslint/explicit-function-return-type': 'off',
  25. '@typescript-eslint/no-explicit-any': 'off',
  26. '@typescript-eslint/no-var-requires': 'off',
  27. '@typescript-eslint/no-empty-function': 'off',
  28. 'vue/custom-event-name-casing': 'off',
  29. 'no-use-before-define': 'off',
  30. '@typescript-eslint/no-use-before-define': 'off',
  31. '@typescript-eslint/ban-ts-comment': 'off',
  32. '@typescript-eslint/ban-types': 'off',
  33. '@typescript-eslint/no-non-null-assertion': 'off',
  34. '@typescript-eslint/explicit-module-boundary-types': 'off',
  35. '@typescript-eslint/no-unused-vars': [
  36. 'error',
  37. {
  38. argsIgnorePattern: '^_',
  39. varsIgnorePattern: '^_',
  40. },
  41. ],
  42. 'no-unused-vars': [
  43. 'error',
  44. {
  45. argsIgnorePattern: '^_',
  46. varsIgnorePattern: '^_',
  47. },
  48. ],
  49. 'space-before-function-paren': 'off',
  50. 'vue/attributes-order': 'off',
  51. 'vue/one-component-per-file': 'off',
  52. 'vue/html-closing-bracket-newline': 'off',
  53. 'vue/max-attributes-per-line': 'off',
  54. 'vue/multiline-html-element-content-newline': 'off',
  55. 'vue/singleline-html-element-content-newline': 'off',
  56. 'vue/attribute-hyphenation': 'off',
  57. 'vue/require-default-prop': 'off',
  58. 'vue/html-self-closing': [
  59. 'error',
  60. {
  61. html: {
  62. void: 'always',
  63. normal: 'never',
  64. component: 'always',
  65. },
  66. svg: 'always',
  67. math: 'always',
  68. },
  69. ],
  70. },
  71. });