Nuxt · NUXT0078
Move plain helpers out of composables/
Finds use-prefixed functions in Nuxt composables/ that use no Vue or Nuxt API and are plain helpers.
nuxt/structure/no-stateless-composablesrc/rule-packs/nuxt/rules/nuxt/composable-placement.ts Upstream docs Run this rule
pnpm nuxt doctor --extends auto,nuxt/strict --rules nuxt/structure/no-stateless-composable
Why it matters
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.
Recommended 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.
Useful links
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, '-')
}