This is a meta-issue for reference and discussion about the challenges posed by code generation for using dartanalyzer in CI.
Angular generates source under the .dart_tool/ directory. While the analysis server understands this convention, the command-line dartanalyzer tool does not, and will produce errors for missing imports.
We workaround this issue by prefixing all of our generated imports (e.g. import 'foo.template.dart' as foo_template;) and ignoring the error for missing imports:
Unfortunately this workaround isn't suitable for generated part files, such as those produced by package:pageloader, as part directives can't be prefixed. This leaves a few options:
.dart_tool/.I think we are going to be asking for tooling to support this properly going forward.
I will open a bug on the SDK repo (https://github.com/dart-lang/sdk/issues/34098).
I just wanted to add, that uri_has_not_been_generated: ignore also only solves part of the problem.
If you have implicit-casts: false then it will continue to fail, since the analyzer doesn't know the types of the imported classes and assumes dynamic for everything.
Most helpful comment
I think we are going to be asking for tooling to support this properly going forward.
I will open a bug on the SDK repo (https://github.com/dart-lang/sdk/issues/34098).