Skip to content

Feature request: lint about imports not in your direct dependencies #42286

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

Closed
sigurdm opened this issue Jun 11, 2020 · 2 comments
Closed

Feature request: lint about imports not in your direct dependencies #42286

sigurdm opened this issue Jun 11, 2020 · 2 comments
Labels
devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead. type-enhancement A request for a change that isn't a bug

Comments

@sigurdm
Copy link
Contributor

sigurdm commented Jun 11, 2020

pub publish will bark at you if you try to publish with an import from a transitive dependency.

But it would be nice to get an upfront alert from a lint that you are importing from a package that is not in the direct dependencies in your pubspec.yaml.

@bwilkerson bwilkerson added devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead. type-enhancement A request for a change that isn't a bug labels Jun 11, 2020
@bwilkerson
Copy link
Member

I like that idea.

On a related note, we've talked in the past about having a lint to check for imports inside lib of packages that are only in the dev dependencies. Not sure whether we want one rule that does both or two separate rules.

@pq

@pq
Copy link
Member

pq commented Jun 11, 2020

👍

See these lint requests (w/ discussion): #57175 and #57176.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devexp-linter Issues with the analyzer's support for the linter package legacy-area-analyzer Use area-devexp instead. type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants