flutter_hooks
flutter_hooks copied to clipboard
Linters like those for javascript react hooks?
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!
It's been on my todo-list for a while. It's possible, but not my priority
@rrousselGit I can contribute for it. Could you please provide some hints about how you would like to implement it?
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.
Sounds great. Thanks!
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.
There's no official solution for now.
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.