solid-software / solid_lints

🟧 Lints for Dart and Flutter based on software industry standards and best practices.
Other
36 stars 17 forks source link

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

Open arthurbcd opened 2 months ago

arthurbcd commented 2 months ago

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.