-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
Add flutter lints #1306
Add flutter lints #1306
Conversation
conflicts because they only add rules (see this Github comment for more information dart-lang/sdk#47256 (comment))
- package:flutter_lints/flutter.yaml | ||
- package:lint/strict.yaml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need to keep both lint packages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It depends on what we want.
What do you think about these three rules : library_private_types_in_public_api, unintended_html_in_doc_comment, use_key_in_widget_constructors ? Should we add them ? If not I guess that we can keep only the lint package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use_key_in_widget_constructors we definitely should have it, and library_private_types_in_public_api looks like a good practice too.
the third one we don't really care.
We should pick the set of rules that best fit our needs, and then adapt by manually enabling/disabling rule individually. Flutter lints is certainly a good choice so we can keep it. Have you found all the differences between flutter_lints and lint/strict?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes there is google sheets at the end of this article that show the differences but this is probably not up to date.
I'll disable the rule about html doc comment.
Ok so So we should keep |
What's the point of adding it I guess the best solution would be to set all lint rules manually like they do in the flutter master repository so we have exactly what we want but that would take some time. |
What's the point of this PR? I thought that you realised some useful rules were missing. If that is the case, change the PR to manually enable the missing rules while keeping the inclusion of |
Well I thought that it would add useful rules because The rules |
The rules that required fixes :
I am not sure if we really want to add this set of rules because some of them seem to especially address to packages like unintended_html_in_doc_comment, use_key_in_widget_constructors, library_private_types_in_public_api. However I think it is still interesting to keep the rules on const.
So I see two options, We can either add manually the two rules on const constructor or add the flutter set of rules and remove the ones that seem specific to Flutter packages.