.eslintrc.cjs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. module.exports = {
  2. root: true,
  3. env: {
  4. browser: true,
  5. node: true,
  6. es2021: true
  7. },
  8. parser: 'vue-eslint-parser',
  9. extends: [
  10. 'eslint:recommended',
  11. 'plugin:vue/vue3-recommended',
  12. 'plugin:@typescript-eslint/recommended',
  13. 'plugin:prettier/recommended',
  14. // eslint-config-prettier 的缩写
  15. 'prettier',
  16. 'vue-global-api'
  17. ],
  18. parserOptions: {
  19. ecmaVersion: 12,
  20. parser: '@typescript-eslint/parser',
  21. sourceType: 'module',
  22. ecmaFeatures: {
  23. jsx: true
  24. }
  25. },
  26. // eslint-plugin-vue @typescript-eslint/eslint-plugin eslint-plugin-prettier的缩写
  27. plugins: ['vue', '@typescript-eslint', 'prettier'],
  28. rules: {
  29. '@typescript-eslint/ban-ts-ignore': 'off',
  30. '@typescript-eslint/no-unused-vars': 'off',
  31. '@typescript-eslint/explicit-function-return-type': 'off',
  32. '@typescript-eslint/no-explicit-any': 'off',
  33. '@typescript-eslint/no-var-requires': 'off',
  34. '@typescript-eslint/no-empty-function': 'off',
  35. '@typescript-eslint/no-use-before-define': 'off',
  36. '@typescript-eslint/ban-ts-comment': 'off',
  37. '@typescript-eslint/ban-types': 'off',
  38. '@typescript-eslint/no-non-null-assertion': 'off',
  39. '@typescript-eslint/explicit-module-boundary-types': 'off',
  40. 'vue/multi-word-component-names': 'off',
  41. 'no-undef': 'off'
  42. },
  43. globals: {
  44. defineProps: 'readonly',
  45. defineEmits: 'readonly',
  46. defineExpose: 'readonly',
  47. withDefaults: 'readonly'
  48. }
  49. };