.eslintrc.js 1.3 KB

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