-
Notifications
You must be signed in to change notification settings - Fork 16
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
Lint rule to disable implicit dynamic values #375
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ikurek
added
the
code-quality
Affects the developer experience when working in our codebase.
label
Apr 21, 2022
ikurek
force-pushed
the
fix/implicit-dynamic
branch
from
April 22, 2022 15:07
d7e55dd
to
313122f
Compare
ikurek
requested review from
KacperKluka,
lukasz-szyszkowski and
QuintinWillison
April 22, 2022 15:08
ikurek
force-pushed
the
fix/implicit-dynamic
branch
from
April 25, 2022 11:30
5d9edca
to
14dc494
Compare
lukasz-szyszkowski
approved these changes
Apr 26, 2022
KacperKluka
approved these changes
Apr 27, 2022
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.
Looks good (after a skim-read) 👍
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This should solve #84. The issue was raised a while ago, and the
implicit dynamic
option was already deprecated, but it was replaced withstrict type checks
. The changes here are mostly cosmetic, but overall they remove ~200 lint warnings in the codebase and remove implicit dynamic typing, which is discouraged in Dart for a while. The changes include:strict-casts
andstrict-inference
lint rules, as a replacement forimplicit-dynamic
. Also, removedavoid_annotating_with_dynamic
andavoid_types_on_closure_parameters
since they conflict withstrict-inference
dynamic
variables where it was possible. There were some cases where the variable/method did not needdynamic
at all, as it's type was declared during asignementtransformState
ortransformStateChange
. With declared variable types, there's no need to use methods that cast variables to their type in cases like this, a simpleas
cast is enough, and reduces a lot of boilerplate codevoid
return types forFuture
methods that do not return any value. Previously these methods returneddynamic
which was always avoid
type