You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Include Flutter-specific lints or add another superset #229
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_lints on package:flutter_lints.
I'm not the biggest fan, mostly because it includes the avoid_print lint, but that can always be disabled :)
Technically will enable more lints even for Dart packages, potentially reducing analysis server performance, but should fail early.
Create a new superset of package:dart_flutter_team_lints, perhaps at lib/flutter_analysis_options.yaml that adds its own set of Flutter specific lints on top.
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.
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 :)
Activity
devoncarew commentedon Jan 22, 2024
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.
devoncarew commentedon Jan 22, 2024
That sounds like your option 2, above.
parlough commentedon Jan 22, 2024
Thanks for adding more background details!
That sounds like a perfect solution to me, giving more flexibility and avoiding the extra dependency. I'd personally suggest not adding
avoid_printbut I can adapt :)