-
Notifications
You must be signed in to change notification settings - Fork 35
Description
Describe the bug
Signal/store wrappers are unable to be properly analyzed.
To Reproduce
Using a wrapper around a signal or store results in the lint warning For proper analysis, array destructuring should be used to capture the first result of this function call.
. Such as @solid-primitives/storage's makePerisisted
:
const SomeComponent = () => {
const [state, setState] = makePersisted(createSignal(false));
// ...
}
Expected behavior
The linter should understand the either these custom wrappers are destructured intelligently via the destructuring into [name, setName]
via the wrapper. Or allow a configuration options to remove ambiguity for what does result in a store/signal like object.
Environment:
- OS: Linux
- Node version:
v20.19.4
eslint-plugin-solid
version:0.14.5
eslint
version:9.35.0
Additional context
Related issue here: #84 with another comment explaining the same issue: #84 (comment)
I think the best solution here is to allow the user to specify what counts as a signal/store wrapper, as I foresee that attempting to intelligently work out what is or isn't to be a deep rabbit hole without any perfect solution.
- I would be willing to contribute a PR to fix this issue
I'm perfectly willing to draft up a PR to fix this, just LMK with a comment, and I'll look at it when I have time.