.eslintrc.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * @Author: wjc
  3. * @Date: 2024-05-27 11:53:23
  4. * @LastEditors: wjc
  5. * @LastEditTime: 2024-05-28 10:01:37
  6. * @Description:
  7. */
  8. module.exports = {
  9. root: true,
  10. env: {
  11. browser: true,
  12. node: true,
  13. },
  14. extends: [
  15. 'plugin:vue/vue3-recommended',
  16. 'plugin:@typescript-eslint/recommended',
  17. 'prettier',
  18. 'plugin:prettier/recommended',
  19. ],
  20. parser: 'vue-eslint-parser',
  21. parserOptions: {
  22. ecmaVersion: 2020,
  23. // 指定eslint解析器
  24. parser: '@typescript-eslint/parser',
  25. // 允许使用 import
  26. sourceType: 'module',
  27. // 允许解析 jsx
  28. ecmaFeatures: {
  29. jsx: true,
  30. },
  31. },
  32. plugins: ['vue', '@typescript-eslint'],
  33. rules: {
  34. 'vue/no-mutating-props': [
  35. 'error',
  36. {
  37. shallowOnly: true, // 启用更改props值但保持引用不变的功能
  38. },
  39. ],
  40. 'vue/valid-template-root': [0],
  41. 'vue/no-reserved-component-names': 'off',
  42. 'vue/multi-word-component-names': 'off',
  43. '@typescript-eslint/no-explicit-any': 'off',
  44. '@typescript-eslint/ban-ts-comment': [0],
  45. '@typescript-eslint/no-unused-vars': [0],
  46. 'space-before-function-paren': 1,
  47. },
  48. }