-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[lints] Prevent non src/ imports from src/ #60615
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
Comments
This issue should likely be filed against the sdk repo; that tracks creating new lints. This package (package:lints) is about promoting current lints to our recommended sets for the community. fwiw, the lint above sounds like it depends on some coding conventions that aren't universal; probably a good use case for the upcoming analyzer plugins work? |
For visibility @srawlins. |
I love it. Might be a good candidate for an analyzer plugin lint, when those become ready. |
Definitely a lint that's based on some choice of modularization and file structuring. Also, the way many packages are written, the top-level libraries are just thin This lint wouldn't do any good in the latter case, since you can just import And other package declare their important types and APIs in the top-level library, and only use Those are all valid approaches, not something we'd want to mandate in any direction. |
I'm happy if I can have custom lints. @srawlins let's connect offline to see if we can migrate what I wrote can be rewritten in what you're working on. |
Often
lib/my_package.dart
exports a bunch oflib/src/xxx.dart
. When working onlib/src/abc.dart
, I want to only import othersrc/xxx.dart
files, I don't want the blanket import of the whole package that imports all public classes.I've created a custom lint for this for the packages I work on, but maybe it would be worth it to have this lint available more generally.
The text was updated successfully, but these errors were encountered: