Skip to content
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

Include Flutter-specific lints or add another superset #229

Open
parlough opened this issue Jan 16, 2024 · 3 comments
Open

Include Flutter-specific lints or add another superset #229

parlough opened this issue Jan 16, 2024 · 3 comments

Comments

@parlough
Copy link
Member

parlough commented Jan 16, 2024

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:

  1. 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.
  2. 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.

A few projects that could benefit:

@devoncarew
Copy link
Member

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
Copy link
Member

That sounds like your option 2, above.

@parlough
Copy link
Member Author

parlough commented Jan 22, 2024

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants