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

depend_on_referenced_packages triggers falsely on virtual flutter_gen package #58690

Closed
goderbauer opened this issue Mar 18, 2022 · 8 comments · Fixed by dart-lang/linter#3309
Assignees
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

@goderbauer
Copy link
Contributor

When a flutter developer adds internationalization to their app as explained in https://docs.flutter.dev/development/accessibility-and-localization/internationalization#adding-your-own-localized-messages it generates a virtual flutter_gen package that the developer has to import in their app (see examples on the linked page). That package does not show up in the pubspec.yaml, but the depend_on_referenced_packages complains about it missing in there.

The flutter_gen package is made available by a rewrite of the package config file. It's a little suspect, but that's what we have right now. Long-term we can hopefully replace this with a macro or something.

In the short-term we need to fix the lint to not complain about this non-existent dependency.

@goderbauer
Copy link
Contributor Author

@mit-mit @pq @srawlins @jonahwilliams

This is currently blocking for rolling the new lints version 2.0 into Flutter. We either need to exclude this lint from the package or come up with a quick fix. Outside of hardcoding an exception into the lint rule itself, I don't see many options, though...

@pq
Copy link
Member

pq commented Mar 18, 2022

/fyi @jakemac53

@jakemac53
Copy link
Contributor

😞 ya this package causes issues for build_runner and I think pub itself as well had some problems with it modifying the package config. We really should change how it works, but in the meantime a hack in the lint can suffice.

@pq
Copy link
Member

pq commented Mar 18, 2022

OK. I've got a "fix" out in dart-lang/linter#3309. I can roll this with some fixes for use_super_parameters (#3306) into a Monday release.

@goderbauer
Copy link
Contributor Author

Thank you!

@bwilkerson
Copy link
Member

@goderbauer Is there a tracking issue to resolve the question of whether it's appropriate to special-case flutter_gen? The issue has come up again (Dart-Code/Dart-Code#3948). It's expensive for the tooling to have to handle special cases like this, but I don't know whether this is a special case that we can get avoid.

@goderbauer
Copy link
Contributor Author

@bwilkerson I filed flutter/flutter#102983 to start a discussion for that.

@pq
Copy link
Member

pq commented May 3, 2022

Excellent. Thanks @goderbauer!

@devoncarew devoncarew added 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. labels Nov 19, 2024
@devoncarew devoncarew transferred this issue from dart-lang/linter Nov 19, 2024
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

Successfully merging a pull request may close this issue.

5 participants