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 or use? 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?
[x] I would be willing to contribute a PR to implement this feature
Yes, even tho I would need a few indications on how to approach the problem
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 oflet/consts/var {...} = ...
, maybe though an option in eslint config?Yes, even tho I would need a few indications on how to approach the problem