Nuxt · Architecture
NUXT0078Move plain helpers out of composables/
Finds use-prefixed functions in Nuxt composables/ that use no Vue or Nuxt API and are plain helpers.
vite-doctor/nuxtarchitectureinfoSuggestion
Why it happens
The use prefix and the composables/ directory tell readers a function must be called from setup. A use* function that never touches Vue reactivity, lifecycle, injection, Nuxt APIs, or other composables can run anywhere, so presenting it as a composable hides that it is safe in event handlers and plain modules.
Fix
Move the function to utils/ and drop the use prefix. The rule only reports functions it can prove are plain; calls to unknown auto-imports or reads of project module state keep a function out of scope.
Example
Move a plain helper to utils
Before
// app/composables/useSlugify.ts
export function useSlugify(input: string) {
return input.toLowerCase().replace(/\s+/g, '-')
}
After
// app/utils/slugify.ts
export function slugify(input: string) {
return input.toLowerCase().replace(/\s+/g, '-')
}
Verify the fix
Run only this rule after editing so the report stays focused on the diagnostic you are closing:
pnpm nuxt doctor --extends auto,nuxt/strict --rules nuxt/structure/no-stateless-composable