flutter_hooks icon indicating copy to clipboard operation
flutter_hooks copied to clipboard

Linters like those for javascript react hooks?

Open fzyzcjy opened this issue 3 years ago • 8 comments
trafficstars

Hi thanks for the lib! In JS, we have https://www.npmjs.com/package/eslint-plugin-react-hooks linters for enforcing the rules of hooks https://reactjs.org/docs/hooks-rules.html (the rules are mostly the same as here). So I wonder whether we can have one? Thanks!

fzyzcjy avatar Feb 23 '22 01:02 fzyzcjy

It's been on my todo-list for a while. It's possible, but not my priority

rrousselGit avatar Feb 23 '22 10:02 rrousselGit

@rrousselGit I can contribute for it. Could you please provide some hints about how you would like to implement it?

fzyzcjy avatar Feb 23 '22 11:02 fzyzcjy

Someone started working on one already https://github.com/mj-hd/flutter_hooks_lint_plugin

I'd reach out to them first to see whether we can merge efforts and make an official solution.

rrousselGit avatar Feb 23 '22 12:02 rrousselGit

Sounds great. Thanks!

fzyzcjy avatar Feb 23 '22 12:02 fzyzcjy

Is this still being worked on? I saw that the one linked above doesn't work with the new lints for riverpod since now Dart only allows one linter. Looks like they're not working on their flutter_hooks linter anymore, wondering if there is an official solution now.

satvikpendem avatar Aug 25 '23 02:08 satvikpendem

There's no official solution for now.

rrousselGit avatar Aug 28 '23 07:08 rrousselGit

Here is another library, which seems to be more actively maintained: https://pub.dev/packages/flutter_hooks_lint

I just started adding hooks in a project and basic hook usage checks seem to work well. Calling them outside the build functions or calling them conditionally etc.

burhanyasar avatar Apr 26 '24 10:04 burhanyasar