Nuxt · NUXT0066
Use VueUse scroll and element composables
Finds VueUse project code that should use the supported use scroll and element pattern instead.
Run this rule
pnpm nuxt doctor --rules vueuse/prefer-use-scroll-and-element
Why it matters
VueUse scroll helpers provide reactive coordinates and manage listeners across mounting, target changes, and disposal.
Recommended fix
Use the VueUse-supported use scroll and element pattern instead.
Useful links
Example
Use VueUse scroll helpers
Before
<script setup lang="ts">
const y = ref(window.scrollY)
window.addEventListener('scroll', () => { y.value = window.scrollY })
</script>
After
<script setup lang="ts">
const { y } = useWindowScroll()
</script>