Nuxt · NUXT0068

Use VueUse timer composables

Finds VueUse project code that should use the supported use timers pattern instead.
NUXT0068vite-doctor/vueuselifecycleinfoSuggestion

Run this rule

pnpm nuxt doctor --rules vueuse/prefer-use-timers

Why it matters

Effects that outlive their component create leaks and stale updates. Register cleanup where Vue or VueUse can dispose it automatically.

Use the VueUse-supported use timers pattern instead.

Example

Use VueUse timers

Before

<script setup lang="ts">
const timer = setInterval(tick, 1000)
onBeforeUnmount(() => clearInterval(timer))
</script>

After

<script setup lang="ts">
useIntervalFn(tick, 1000)
</script>
Copyright © 2026