nuxt / nuxt/nuxt

Better handling of aliases in layers

Open
#33,528 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

discussion pending triage possible regression
Dominant language
TypeScript
Stars
60.9k
Forks
5.8k
Avg merge
7h 8m
Merged PRs (30d)
162

Description

Describe the feature

Named layer aliases are great. However, a lot of the time, WebStorm (and possibly other IDEs) suggests @ or ~ for shortening imports or uses those aliases when automatically generating imports - even when the layer has its own alias.

Basically, when working with layers, you almost never want to use @ to import things.

Would it be possible to either give higher priority to the layer aliases or add an option to remove @, ~, ... altogether?

I don't think removing them would break anything, since modules should use resolved paths anyway. Or am I missing something?

Additional information
  • Would you be willing to help implement this feature?
  • Could this feature be implemented as a module?
Final checks

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by locating Nuxt's layer alias and import-resolution entry points, then determine whether the intended outcome is layer-alias precedence or an option to disable aliases such as @ and ~. Done should include an agreed behavior and coverage for the selected approach.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxt, typescript
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.