-
Notifications
You must be signed in to change notification settings - Fork 30
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
I'd love a "strict" version of flutter_lints #216
Comments
We've avoided doing that in the past (and in fact a previous proposal for this caused us to update our lint set descriptions here: https://github.com/dart-lang/lints?tab=readme-ov-file#lint-sets). The subjectivity increases quite a bit with strict lint sets, and something we ship often gets interpreted as the canonical version of something. Our current strategy is to publicize community lint sets (ala https://pub.dev/packages?q=topic%3Alints) - things built on top of the core, recommended, and flutter sets. We're happy to hear other thoughts though - either re-deciding against shipping strict sets, or, better publicizing 1-3 of the more highly used, well-thought out sets. |
Well that’s great and I use all_lint_rules_community myself (as I mentioned) except that @mit-mit doesn’t allow any submissions to the flutter org on GitHub to use anything that isn’t created by the Flutter team itself. So now flutter_lints is the required set and it’s inadequate (imo) for production quality code. |
Hmm, generally, turning all the lints on is somewhat concerning. Several of the lints conflict - have opposite recommendations. Some are less well thought out, have less-than-complete implementations, or haven't aged well with the language.
I am curious - which additional lints do you get value out of? Where do you see the gap between package:core+recommended+flutter_lints and production quality code? |
Of course. I turn them all on and then eliminate the conflicts via a custom analysis_options.yaml. Ideally this would be part of a flutter_lints_strict package out of the box.
“There are so many things that flutter_lints doesn't flag, like dynamic type usage, the lack of docs on public APIs for packages, unawaited async calls, etc.” |
The flutter_lints package is a great way to balance recommended style vs. ease-of-use for new Dart and Flutter devs. But for advanced Flutter devs or devs build Dart or Flutter packages, I want a "strict" mode that cranks down the screws and helps me to write much better code.
Personally, I use the all_lint_rules_community package for this and it feels like unlocking the other half of the Dart compiler. It's kept up to date: as the Dash team adds new lints, they're automatically added and I automatically get better code. Frankly, it's amazing.
There are so many things that flutter_lints doesn't flag, like dynamic type usage, the lack of docs on public APIs for packages, unawaited async calls, etc. I wouldn't dream of building an without these lints in place, let alone a package that I expect other folks to use.
It makes sense that flutter_lints is not for that -- but there should be some curated set of lints for folks that really want to use Dart and Flutter like the pros do. Perhaps start with the Flutter team's analysis_options.yaml and build from there (and don't forget these)?
Thoughts? @mit-mit @devoncarew @pq
The text was updated successfully, but these errors were encountered: