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

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

Closed
1 task
GiyoMoon opened this issue Aug 21, 2023 · 2 comments
Closed
1 task

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

GiyoMoon opened this issue Aug 21, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@GiyoMoon
Copy link

GiyoMoon commented Aug 21, 2023

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):

  • OS: MacOS Venture 13.5
  • Node version (node --version): v18.17.0
  • eslint-plugin-solid version (npm list eslint-plugin-solid/yarn why eslint-plugin-solid): 0.13.0
  • eslint version (npm list eslint/yarn why eslint): 8.47.0
  • I would be willing to contribute a PR to fix this issue
@GiyoMoon GiyoMoon added the bug Something isn't working label Aug 21, 2023
@GiyoMoon GiyoMoon changed the title .map calls under a Fragment are being ignored .map expressions directly under a Fragment are being ignored Aug 21, 2023
@joshwilsonvu
Copy link
Collaborator

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
Copy link
Author

Thank you very much!

joshwilsonvu added a commit that referenced this issue Dec 30, 2023
Check JSXFragment in most places where checking JSXElement, fixes #106.
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

No branches or pull requests

2 participants