solidjs-community / eslint-plugin-solid

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

.map expressions directly under a Fragment are being ignored #106

Closed GiyoMoon closed 6 months ago

GiyoMoon commented 10 months ago

Describe the bug The plugin doesn't warn about using .map on a signal if the expression is directly under a fragment in the jsx.

To Reproduce

git clone https://github.com/GiyoMoon/solidjs-eslint-map-bug.git
cd solidjs-eslint-map-bug
pnpm install

Open the ./src/App.tsx file in your IDE which is running eslint. You should notice that only one of the two .map expressions are being noticed by eslint.

Expected behavior Both .map expression should give eslint warnings.

Screenshots image

Environment (please complete the following information):

joshwilsonvu commented 10 months ago

Thanks for catching this! You're right, the problem isn't caught directly under a Fragment, just regular JSX elements. They're parsed differently by ESLint, and I didn't catch that case.

Will be a small fix—I'll have it out on the next release!

GiyoMoon commented 10 months ago

Thank you very much!