Nuxt · NUXT0067

Use VueUse storage composables

Finds VueUse project code that should use the supported use storage pattern instead.
NUXT0067vite-doctor/vueusebrowser-apiinfoSuggestion

Run this rule

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

Why it matters

Manual storage reads and watches duplicate serialization, cross-tab synchronization, default handling, and reactive updates already handled by useStorage().

Use VueUse useLocalStorage() or useSessionStorage() for client storage so refs, serialization, and cleanup stay together. In SSR apps, pass { initOnMounted: true } so the first client render matches the server, or use useCookie() for state the server must render.

Example

Use VueUse storage

Before

const theme = ref(localStorage.getItem('theme') || 'light')
watch(theme, value => localStorage.setItem('theme', value))

After

const theme = useLocalStorage('theme', 'light', { initOnMounted: true })
Copyright © 2026