Add support for destructuring @solidjs/router hooks #72
Labels
enhancement
New feature or request
reactivity v2
To be addressed in the rewrite of the solid/reactivity rule
Describe the need
At the moment, the destructuring error only appears for props. It's an issue for any reactive value being destructured though. This happened to me while using @solidjs/router's useParams
which should not be destructured. I understand it's impossible to detect what is reactive and what not from the eslint plugin, but maybe adding support for @solidjs/router would be a cool addition.
Suggested Solution
Add support for @solidjs/router, by detecting destructures on its hooks.
Possible Alternatives
Maybe detect function hooks being called inside a component that start with
create
oruse
? Pretty heuristic though.Another solution could be to prevent all destructures in the form of
let/consts/var {...} = ...
, maybe though an option in eslint config?Yes, even tho I would need a few indications on how to approach the problem
The text was updated successfully, but these errors were encountered: