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

First argument to mapArray should be recognised as a tracked scope #55

Closed
jfrere opened this issue Jan 2, 2023 · 0 comments · Fixed by #56
Closed

First argument to mapArray should be recognised as a tracked scope #55

jfrere opened this issue Jan 2, 2023 · 0 comments · Fixed by #56
Assignees
Labels
bug Something isn't working

Comments

@jfrere
Copy link
Contributor

jfrere commented Jan 2, 2023

Describe the bug

The first argument to mapArray is a function that is run within a tracked scope, but eslint-plugin-solid does not recognise it as a tracked scope.

To Reproduce

export function createCustomStore(): Accessor<CustomItem[]> {
  const [store, updateStore] = createStore({
    /* ... */
  });

  return mapArray(
    // warning: This function should be passed to a tracked scope (like createEffect) or an event handler because it contains reactivity (solid/reactivity)
    () => store.path.to.field,
    (item) => ({
      /* ... */
    })
  );
}

Expected behavior

mapArray should be recognised as using tracked scopes.

Environment (please complete the following information):

  • OS: Mac OS 13.1
  • Node version (node --version): 19.2.0
  • eslint-plugin-solid version (npm list eslint-plugin-solid/yarn why eslint-plugin-solid): 0.9.1
  • eslint version (npm list eslint/yarn why eslint): 8.29.0

Additional context

I've split this problem off from #52 as discussed there

@jfrere jfrere added the bug Something isn't working label Jan 2, 2023
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
Development

Successfully merging a pull request may close this issue.

2 participants