solid_lints icon indicating copy to clipboard operation
solid_lints copied to clipboard

`avoid_late_keyword` - `ignored_types` not working as expected.

Open arthurbcd opened this issue 3 months ago • 0 comments

I'm currently using:

    - avoid_late_keyword:
      allow_initialized: true
      ignored_types:
        - AnimationController
        - StreamSubscription
        - Timer

Timer is working fine and AnimationController too, but StreamSubscription is not working and here is why:

checkedTypes: {StreamSubscription<dynamic>, Object}

The code is trying to compare StreamSubscription with StreamSubscription<dynamic> strings, so It will always fail.

I suggest creating a pattern to ignore the subtype of the node type, effectively removing the <dynamic> part. Note that in some cases, the node type may have more than one subtype, but I believe a pattern for removing everything after < should be enough.

This is a really good package, by the way. Great job.

arthurbcd avatar Apr 14 '24 20:04 arthurbcd