-
Notifications
You must be signed in to change notification settings - Fork 20
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
Improved avoid_late_keyword
to support ignoring the subtype of the node type (#157)
#158
Conversation
…node type (support for nested types for dynamic, Object?, Object) solid-software#157
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.
General logic LGTM, great start!;
Implementation-wise -- I think we are relying on raw regexp/string matching too much here. We should try and leverage the static types and utilities that analyzer/ast provides us.
Here's some stuff we may be able to use:
- https://pub.dev/documentation/analyzer/latest/dart_ast_token/Keyword/DYNAMIC-constant.html
- https://pub.dev/documentation/analyzer/latest/dart_element_type/DynamicType-class.html
- https://pub.dev/documentation/analyzer/latest/dart_element_type_provider/TypeProvider/objectType.html
- https://pub.dev/documentation/analyzer/latest/dart_element_type/TypeParameterType-class.html
We should also be more vigorous about testing this. I've added a couple ideas, but I'm sure you can expand on them.
Co-authored-by: Yurii Prykhodko <[email protected]>
Co-authored-by: Yurii Prykhodko <[email protected]>
…lyze and compare type names
...t/avoid_late_keyword_allow_no_type_specified/avoid_late_keyword_allow_no_type_specified.dart
Outdated
Show resolved
Hide resolved
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.
LGTM!
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.
LGTM - thanks
avoid_late_keyword
-ignored_types
not working as expected. #157