-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Allow disabling lints in the analyzer for certain file patterns #34069
Comments
We have the ability to |
I think we want to include strong mode type checking since some bugs in user written code can end up reflected as type errors in generated code. |
In which case, the solution is for the user to modify something outside the generated code. Is there any way we could produce the error at the location where the change needs to be made instead of in the generated code? If so, that would be a better UX. |
Yeah I think that's the ideal, and that's what we achieved with the angular plugin for the analyzer. It is a lot more work on the part of the codegen author to get there, and when they don't take those steps it's a bit worse experience for the user when they hit problems at runtime instead of analysis time. Once the CFE has caught up and implemented all static errors that might be enough to mitigate this since at least you'd get the errors at the start of the run instead of after some code has already started... |
@zoechi - how well does it work for you to include these generated files in an |
There are still exclude related issues open, therefore havem't tried since a while. |
@natebosch exclude didn't work. |
Dup of dart-lang/linter#320 ? |
To give an example of an issue I hit today - I was using Currently it seems like the choice is between
If there's another option that's less-bad than those, I'd love to know :-) |
Lints might not be the only things - as we add more things like See #30386 |
Since authors of codegen utilities can't know the full set of (possibly contradictory) lints that a end user has enabled we end up generating code that doesn't pass all lints and in some cases hack around this by adding a bunch of
// ignore_for_file:
for lints users might be using that the generated code doesn't conform to. This isn't sustainable since the set of lints is a moving target.A much better solution would be to allow a user to configure such that, for example
**.g.dart
and**.template.dart
files don't get lints (and maybe opt in strict checks) applied but do still get other analysis applied.The text was updated successfully, but these errors were encountered: