ecosystem
ecosystem copied to clipboard
Include Flutter-specific lints or add another superset
I'd really like to standardize all of my dart-lang and flutter org contributions to use this as a single analysis package, however that's difficult as Flutter apps often like to base their analysis on package:flutter_lints, which includes some helpful Flutter-specific lints. This results in a mix not only between repositories, but sometimes within the same repository.
Primary options:
-
Base
package:dart_flutter_team_lintsonpackage:flutter_lints.- I'm not the biggest fan, mostly because it includes the
avoid_printlint, but that can always be disabled :) - Technically will enable more lints even for Dart packages, potentially reducing analysis server performance, but should fail early.
- I'm not the biggest fan, mostly because it includes the
-
Create a new superset of
package:dart_flutter_team_lints, perhaps atlib/flutter_analysis_options.yamlthat adds its own set of Flutter specific lints on top.
A few projects that could benefit:
Hmm. For background:
package:dart_flutter_team_lints is based on package:lints/recommended.yaml. package:lints is the set of lints we recommend that dart users use. dart_flutter_team_lints is the delta on top of that that we ourselves would like to use, but that we don't feel we need to recommend generally.
package:flutter_lints are the flutter specific set of lints - on top of package:lints/recommended.yaml - that we feel all flutter projects should use.
I think you're looking for a lint set - based on package:lints/recommended.yaml - that combines the deltas from both package:dart_flutter_team_lints and package:flutter_lints.
I think it would be nice if we avoided adding a new package dependency here (on package:flutter_lints), so I think in-lining the content from flutter_lints would make sense.
Perhaps a new file in this package - package:dart_flutter_team_lints/flutter_lints.yaml? It could depend on package:dart_flutter_team_lints/analysis_options.yaml, and manually add all the current lints from the flutter_lints package.
That sounds like your option 2, above.
Thanks for adding more background details!
Perhaps a new file in this package - package:dart_flutter_team_lints/flutter_lints.yaml? It could depend on package:dart_flutter_team_lints/analysis_options.yaml, and manually add all the current lints from the flutter_lints package.
That sounds like a perfect solution to me, giving more flexibility and avoiding the extra dependency. I'd personally suggest not adding avoid_print but I can adapt :)