-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
Domain: Auto-importExperience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsFix AvailableA PR has been opened for this issueA PR has been opened for this issueRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestoneSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
The auto-import feature is amazing. Something I come across daily though is the import I want is nearly always the second or third choice.
In the screenshots below VS Code suggests to import db
from ../../admin/helpers/db
before ../helpers/db
I would propose that the ordering is sorted by distance from the current file. The following ESLint rule (that I use in most of my projects) does this correctly and presumably has code that can be reused: eslint-plugin-import/order (well, except we want the inverse of this — shortest distance first).
a-tarasyuk, just-boris, ValentinH, ngmariusz, rolivegab and 7 more
Metadata
Metadata
Assignees
Labels
Domain: Auto-importExperience EnhancementNoncontroversial enhancementsNoncontroversial enhancementsFix AvailableA PR has been opened for this issueA PR has been opened for this issueRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestoneSuggestionAn idea for TypeScriptAn idea for TypeScript