-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import priority tool #59702
Comments
Summary: User requests improved tooling for managing Dart imports, suggesting annotations to prioritize specific exports or a tool to help choose the correct import based on project structure and internal import rules. |
I have the same issue
Every time I want to import something from |
For your particular issue, might I suggest instead |
@Levi-Lesches |
Not long ago I've closed an issue where now if you have one of the lints enabled it should only suggest that kind of import (relative or package) but I've also added a new version for "with show" so the number is the same with more meaning:
These should land on Dart 3.7. |
In dart-lang/language#4112 one technique discussed/suggested is to
export
a library withshow
/hide
.Originally posted by @TekExplorer in dart-lang/language#4112 (comment)
In my company, we have an internal rule. Say we have the following project structure:
a
orb
, we'd import the barrel files forf1
orf2
.a1
and we need something fromb1
we'd import it directly, if we need anything else we'd import the closest file with that declaration (meaninga
,b
orf2/f2
)a2
we'd follow the same rule as above (for files insidef3
we'd import its barrel)f3
we'd import only barrel files ora
/b
.I'm sure other projects have other rules for this but the point stands that importing the right file is a bit hard and a better tool for this would be a great addition!
Not sure what to suggest besides the above but I'm opening this as a place for this conversation.
P.S.: If this is not the right place to open this please say so.
The text was updated successfully, but these errors were encountered: