solidjs-community / eslint-plugin-solid

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

casting the `createMemo` result triggers warning #60

Closed aminya closed 1 year ago

aminya commented 1 year ago

Describe the bug

When as is used on the result of the createMemo in TypeScript, this warning is triggered:

For proper analysis, a variable should be used to capture the result of this function call.eslint[solid/reactivity](https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/reactivity.md)

Removing as fixes the issue.

To Reproduce

const value = createMemo(() => { 
    // things
}) as MyType

Expected behavior

Support as

Screenshots

Environment (please complete the following information):

Additional context