solidjs-community / eslint-plugin-solid

Solid-specific linting rules for ESLint.
MIT License
209 stars 24 forks source link

passing lambdas to `use:` hooks causes warnings #85

Closed aminya closed 1 year ago

aminya commented 1 year ago

Describe the bug passing lambdas to use: hooks causes warnings

This function should be passed to a tracked scope (like createEffect) or an event handler because it contains reactivity, or else changes will be ignored.eslint[solid/reactivity](https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/reactivity.md)

To Reproduce

const someHook = createSomeHook();
someHook;

<div
        use:someHook={() => {
            // do something
        }}
      >

Expected behavior

Screenshots

Environment (please complete the following information):

Additional context