avoid-misused-hooks
Warns when hooks are used in non-hook widgets.
Example
❌ Bad:
class SomeWidget extends StatelessWidget {
const SomeWidget();
Widget build(BuildContext context) {
useMemoized(() => {}, keys); // LINT
return Container();
}
}
✅ Good:
class SomeHookWidget extends HookWidget {
const SomeHookWidget();
Widget build(BuildContext context) {
useMemoized(() => {}, keys);
return Container();
}
}