Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solid/reactivity rule does not report nested signal call in non tracked scope #124

Closed
1 task
tronikelis opened this issue Dec 31, 2023 · 2 comments · Fixed by #125
Closed
1 task

solid/reactivity rule does not report nested signal call in non tracked scope #124

tronikelis opened this issue Dec 31, 2023 · 2 comments · Fixed by #125
Assignees
Labels
bug Something isn't working

Comments

@tronikelis
Copy link

tronikelis commented Dec 31, 2023

Describe the bug
Best way to explain is an example

https://playground.solidjs.com/anonymous/695d5961-9a9d-4422-8d72-e1d8f06cf98e

function useExample(input: number | number[]) {}

function Counter(props: ComponentProps<"button">) {
  const [c, setC] = createSignal(1);
  
  // reports, nice
  useExample(c());
  // does not report
  useExample([c()]);

  return <div>hello</div>;
}

Expected behavior
Should report for both of them

Environment (please complete the following information):

  • OS: Windows 10
  • Node version 20.10.0
  • eslint-plugin-solid version 0.13.1
  • eslint version 8.56.0
  • I would be willing to contribute a PR to fix this issue
@tronikelis tronikelis added the bug Something isn't working label Dec 31, 2023
@joshwilsonvu
Copy link
Collaborator

Hmm, thanks for this. Looks like in an attempt to allow code like

useExample([() => c()])

I inadvertently allowed code like useExample([c()]). Will just need to tighten up the checks for custom hooks—they're meant to be pretty permissive, but definitely not meant to allow incorrect code like this.

@tronikelis
Copy link
Author

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants