Skip to content
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

Add lint for importing transitive dependency #36808

Closed
shyndman opened this issue Apr 30, 2019 · 3 comments
Closed

Add lint for importing transitive dependency #36808

shyndman opened this issue Apr 30, 2019 · 3 comments
Labels
analyzer-linter Issues with the analyzer's support for the linter package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.

Comments

@shyndman
Copy link

shyndman commented Apr 30, 2019

Hi there.

It would be great if we could get a lint to let us know when transitive dependencies are being imported. Ideally we'd like to only depend on packages that we specify in our own pubspec.

Thanks!

@krisgiesing
Copy link

krisgiesing commented May 1, 2019

Just to clarify, this is to identify the issue where we directly reference a package in code but we only depend on it transitively (in the pubspec sense). This can become an unexpected failure if the transitive dependencies change.

@devoncarew
Copy link
Member

Sounds like a valuable lint.

The lint itself would appear in the imports for a library. It would depend in the information from that library (the imports) as well as the information from the pubspec file. I don't know if the current architecture of the linter is set up to handle that well.

Technically, this might instead be implemented as an analyzer hint. cc'ing @bwilkerson and @pq for where the best impl for this would live, and whether we should track here or in the linter repo.

@devoncarew devoncarew added area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. analyzer-linter Issues with the analyzer's support for the linter package labels May 1, 2019
@pq
Copy link
Member

pq commented May 3, 2019

This one has been on our linter todo list for a while: #57175.

Please feel free to upvote and add any additional context there!

@pq pq closed this as completed May 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
analyzer-linter Issues with the analyzer's support for the linter package area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion.
Projects
None yet
Development

No branches or pull requests

4 participants