eslint.config.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. }
  41. }
  42. );