eslint.config.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import pluginVue from 'eslint-plugin-vue';
  2. import globals from 'globals';
  3. import prettier from 'eslint-plugin-prettier';
  4. import {defineConfigWithVueTs, vueTsConfigs} from '@vue/eslint-config-typescript';
  5. import skipFormatting from '@vue/eslint-config-prettier/skip-formatting';
  6. export default defineConfigWithVueTs(
  7. {
  8. name: 'app/files-to-lint',
  9. files: ['**/*.{js,cjs,ts,mts,tsx,vue}']
  10. },
  11. {
  12. name: 'app/files-to-ignore',
  13. ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**']
  14. },
  15. {
  16. languageOptions: {
  17. globals: globals.browser
  18. }
  19. },
  20. pluginVue.configs['flat/essential'],
  21. vueTsConfigs.recommended,
  22. skipFormatting,
  23. {
  24. plugins: {prettier},
  25. rules: {
  26. '@typescript-eslint/no-empty-function': 'off',
  27. '@typescript-eslint/no-explicit-any': 'off',
  28. '@typescript-eslint/no-unused-vars': 'off',
  29. '@typescript-eslint/no-this-alias': 'off',
  30. // vue
  31. 'vue/multi-word-component-names': 'off',
  32. 'vue/valid-define-props': 'off',
  33. 'vue/no-v-model-argument': 'off',
  34. 'prefer-rest-params': 'off',
  35. // prettier
  36. 'prettier/prettier': 'error',
  37. // 允许使用空Object类型 {}
  38. '@typescript-eslint/no-empty-object-type': 'off',
  39. '@typescript-eslint/no-unused-expressions': 'off',
  40. 'vue/no-mutating-props': 'off'
  41. }
  42. }
  43. );