.eslintrc.js 980 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. module.exports = {
  2. root: true,
  3. env: {
  4. node: true
  5. },
  6. extends: [
  7. 'eslint:recommended',
  8. 'plugin:vue/vue3-recommended'
  9. ],
  10. globals: {
  11. // Vue3 API(uni-app 已内置)
  12. ref: 'readonly',
  13. reactive: 'readonly',
  14. computed: 'readonly',
  15. watch: 'readonly',
  16. watchEffect: 'readonly',
  17. onMounted: 'readonly',
  18. onUnmounted: 'readonly',
  19. nextTick: 'readonly',
  20. getCurrentInstance: 'readonly',
  21. // Vue3 SFC 宏(无需 import)
  22. defineProps: 'readonly',
  23. defineEmits: 'readonly',
  24. defineExpose: 'readonly',
  25. withDefaults: 'readonly',
  26. // uni-app API
  27. uni: 'readonly',
  28. // uni-app 页面生命周期
  29. onLoad: 'readonly',
  30. onShow: 'readonly',
  31. onHide: 'readonly',
  32. onReady: 'readonly',
  33. onUnload: 'readonly',
  34. onPullDownRefresh: 'readonly',
  35. onReachBottom: 'readonly',
  36. onShareAppMessage: 'readonly'
  37. },
  38. rules: {
  39. // 可按需要添加规则
  40. "quotes": ["error", "double"]
  41. }
  42. }