Nuxt · NUXT0096
Import across Nuxt directories through an alias
Flags imports that climb two or more directories in app/, server/ or shared/.
nuxt/imports/prefer-alias-over-relative-parentsrc/rule-packs/nuxt/rules/nuxt/prefer-alias-over-relative-parent.ts Upstream docs Run this rule
pnpm nuxt doctor --rules nuxt/imports/prefer-alias-over-relative-parent
Why it matters
A chain of ../ breaks when a file moves and hides which part of the app it reaches into. Nuxt aliases depend on the installed version and configured directories; a replacement must point to the same module.
Recommended fix
Use an alias from the project's resolved Nuxt configuration. Concrete replacements are suggested only when the alias base is known.
Useful links
Example
Import shared code through #shared
Before
// server/api/events/[slug].get.ts
import { toVenueTime } from '../../../shared/utils/time'
After
import { toVenueTime } from '#shared/utils/time'