.eslintrc.cjs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. module.exports = {
  2. env: {
  3. browser: true,
  4. es2021: true,
  5. node: true
  6. },
  7. extends: [
  8. // 'eslint:recommended',
  9. 'plugin:vue/vue3-essential',
  10. 'plugin:@typescript-eslint/recommended',
  11. 'plugin:prettier/recommended',
  12. 'prettier',
  13. 'eslint-config-prettier'
  14. ],
  15. overrides: [],
  16. parser: 'vue-eslint-parser',
  17. parserOptions: {
  18. ecmaVersion: 'latest',
  19. sourceType: 'module',
  20. parser: '@typescript-eslint/parser'
  21. // "parser": 'vue-eslint-parser'
  22. },
  23. plugins: ['vue', 'prettier', '@typescript-eslint'],
  24. globals: {
  25. defineProps: 'readonly',
  26. defineEmits: 'readonly',
  27. defineExpose: 'readonly',
  28. withDefaults: 'readonly'
  29. },
  30. rules: {
  31. quotes: [1, 'single'],
  32. 'prettier/prettier': 'off',
  33. // 'prettier/prettier': ['error', { singleQuote: true, parser: 'flow' }],
  34. 'vue/multi-word-component-names': 'off',
  35. 'no-var': 'error',
  36. 'no-multiple-empty-lines': ['error', { max: 1 }],
  37. 'no-use-before-define': 'off',
  38. 'prefer-const': 'off',
  39. 'no-irregular-whitespace': 'off',
  40. '@typescript-eslint/no-unused-vars': 'error',
  41. '@typescript-eslint/prefer-ts-expect-error': 'error',
  42. '@typescript-eslint/no-inferrable-types': 'off',
  43. '@typescript-eslint/no-explicit-any': 'off' // 禁止使用 any 类型
  44. }
  45. }