Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

New option for typescript.preferences.importModuleSpecifier to use relative only if path starts with ./ #48192

Closed
AlbertoSadoc opened this issue Mar 9, 2022 · 3 comments
Labels
Duplicate An existing issue was already created

Comments

@AlbertoSadoc
Copy link

I would like an option to import modules using always non-relative urls except if it can be a relative url starting with ./.

non-relative is great to show the full path the file is referenced, specially if the relative path have several ../ path segments. shortest still can show several ../ path segments if relative path is shorter than the non-relative path. This new option will avoid ../ at all costs but can use relative if the file is located under the same folder of the current file.

An extra option would be to also allow one single ../ as it is going up the path just once which it is not very confusing either.

@AlbertoSadoc AlbertoSadoc changed the title New option for typescript.preferences.importModuleSpecifier to use relative only if path starts with ./ New option for typescript.preferences.importModuleSpecifier to use relative only if path starts with ./ Mar 9, 2022
@mjbvz mjbvz transferred this issue from microsoft/vscode Mar 9, 2022
@RyanCavanaugh RyanCavanaugh added Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Suggestion An idea for TypeScript labels Mar 10, 2022
@laverdet
Copy link
Contributor

+1 as described is exactly what I'd like as well.

shortest is currently the best we have. TypeScript has good support for self-referencing packages but we have to choose between either always using full references [non-relative] or an unreliable sometimes-relative sometimes-absolute hybrid [shortest].

@dmitri-gb
Copy link
Contributor

dmitri-gb commented Apr 2, 2024

Duplicate of #45015.

@RyanCavanaugh RyanCavanaugh added Duplicate An existing issue was already created and removed Suggestion An idea for TypeScript Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Domain: Auto-import labels Apr 12, 2024
@typescript-bot
Copy link
Collaborator

This issue has been marked as "Duplicate" and has seen no recent activity. It has been automatically closed for house-keeping purposes.

@typescript-bot typescript-bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 15, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

6 participants