eslint.config.mjs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import js from '@eslint/js';
  2. import vue from 'eslint-plugin-vue';
  3. import tseslint from '@typescript-eslint/eslint-plugin';
  4. import vueParser from 'vue-eslint-parser';
  5. import globals from 'globals';
  6. export default [
  7. {
  8. ignores: [
  9. '**/*.sh',
  10. '**/node_modules',
  11. '**/lib',
  12. '**/*.md',
  13. '**/*.scss',
  14. '**/*.woff',
  15. '**/*.ttf',
  16. '**/.vscode',
  17. '**/.idea',
  18. '**/dist',
  19. '**/mock',
  20. '**/public',
  21. '**/bin',
  22. '**/build',
  23. '**/config',
  24. '**/index.html',
  25. 'src/assets',
  26. ],
  27. },
  28. js.configs.recommended,
  29. {
  30. plugins: {
  31. vue,
  32. '@typescript-eslint': tseslint,
  33. },
  34. languageOptions: {
  35. parser: vueParser,
  36. parserOptions: {
  37. parser: '@typescript-eslint/parser',
  38. ecmaVersion: 2022,
  39. sourceType: 'module',
  40. },
  41. globals: {
  42. ...globals.browser,
  43. ...globals.node,
  44. },
  45. },
  46. rules: {
  47. '@typescript-eslint/ban-ts-ignore': 'off',
  48. '@typescript-eslint/explicit-function-return-type': 'off',
  49. '@typescript-eslint/no-explicit-any': 'off',
  50. '@typescript-eslint/no-var-requires': 'off',
  51. '@typescript-eslint/no-empty-function': 'off',
  52. '@typescript-eslint/no-use-before-define': 'off',
  53. '@typescript-eslint/ban-ts-comment': 'off',
  54. '@typescript-eslint/ban-types': 'off',
  55. '@typescript-eslint/no-non-null-assertion': 'off',
  56. '@typescript-eslint/explicit-module-boundary-types': 'off',
  57. '@typescript-eslint/no-redeclare': 'off',
  58. '@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
  59. '@typescript-eslint/no-unused-vars': ['warn', {
  60. 'args': 'all',
  61. 'argsIgnorePattern': '^_',
  62. 'caughtErrors': 'all',
  63. 'caughtErrorsIgnorePattern': '^_',
  64. 'destructuredArrayIgnorePattern': '^_',
  65. 'varsIgnorePattern': '^_',
  66. 'ignoreRestSiblings': true
  67. }],
  68. 'vue/no-unused-vars': 'off',
  69. 'vue/no-mutating-props': 'warn',
  70. 'vue/custom-event-name-casing': 'off',
  71. 'vue/attributes-order': 'off',
  72. 'vue/one-component-per-file': 'off',
  73. 'vue/html-closing-bracket-newline': 'off',
  74. 'vue/max-attributes-per-line': 'off',
  75. 'vue/multiline-html-element-content-newline': 'off',
  76. 'vue/singleline-html-element-content-newline': 'off',
  77. 'vue/attribute-hyphenation': 'off',
  78. 'vue/valid-v-else': 'warn',
  79. 'vue/no-deprecated-filter': 'warn',
  80. 'vue/html-self-closing': 'off',
  81. 'vue/no-multiple-template-root': 'off',
  82. 'vue/require-default-prop': 'off',
  83. 'vue/no-v-model-argument': 'off',
  84. 'vue/no-arrow-functions-in-watch': 'off',
  85. 'vue/no-template-key': 'off',
  86. 'vue/no-v-for-template-key': 'warn',
  87. 'vue/no-v-html': 'off',
  88. 'vue/comment-directive': 'off',
  89. 'vue/no-parsing-error': 'off',
  90. 'vue/no-deprecated-v-on-native-modifier': 'off',
  91. 'vue/multi-word-component-names': 'off',
  92. 'no-constant-binary-expression': 'warn',
  93. 'no-useless-escape': 'off',
  94. 'no-sparse-arrays': 'off',
  95. 'no-prototype-builtins': 'off',
  96. 'no-constant-condition': 'off',
  97. 'no-use-before-define': 'off',
  98. 'no-restricted-globals': 'off',
  99. 'no-restricted-syntax': 'off',
  100. 'generator-star-spacing': 'off',
  101. 'no-unreachable': 'off',
  102. 'no-multiple-template-root': 'off',
  103. 'no-unused-vars': 'off',
  104. 'no-v-model-argument': 'off',
  105. 'no-case-declarations': 'off',
  106. 'no-console': 'off',
  107. 'no-redeclare': 'off',
  108. },
  109. },
  110. {
  111. files: ['**/*.ts', '**/*.tsx', '**/*.vue'],
  112. rules: {
  113. 'no-undef': 'off',
  114. },
  115. },
  116. ];