.eslintrc.cjs 890 B

12345678910111213141516171819202122232425262728293031323334353637
  1. module.exports = {
  2. root: true,
  3. env: {
  4. browser: true,
  5. es2024: true,
  6. node: true,
  7. },
  8. extends: [
  9. 'eslint:recommended',
  10. 'plugin:vue/vue3-recommended',
  11. '@vue/eslint-config-typescript',
  12. '@vue/eslint-config-prettier',
  13. ],
  14. parserOptions: {
  15. ecmaVersion: 'latest',
  16. parser: '@typescript-eslint/parser',
  17. sourceType: 'module',
  18. },
  19. plugins: ['vue', '@typescript-eslint'],
  20. rules: {
  21. // 自定义规则
  22. 'vue/multi-word-component-names': 'off', // 允许单文件组件使用单个单词
  23. '@typescript-eslint/no-explicit-any': 'off', // 允许使用 any 类型
  24. 'vue/html-self-closing': [
  25. 'error',
  26. {
  27. // 自闭合标签配置
  28. html: {
  29. void: 'always',
  30. normal: 'always',
  31. component: 'always',
  32. },
  33. },
  34. ],
  35. 'prettier/prettier': ['error', { endOfLine: 'auto' }],
  36. },
  37. }