-
-
Notifications
You must be signed in to change notification settings - Fork 511
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
[WIP] SolidJS Components return once #2439
base: main
Are you sure you want to change the base?
[WIP] SolidJS Components return once #2439
Conversation
✅ Deploy Preview for biomejs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
What do you need from us about this PR @marvin-j97? This PR is in stale for while |
I've been pretty busy with other projects so I haven't really been working on Biome. What I do wonder is how to implement early returns. It probably needs control flow graph checking...? |
Actually, no. Usually you want to use the CFG (control flow graph) to detect if something isn't reached. Instead, you want to detect if you return statements in places where they should not be. This means you just need to query return statements and query their ancestors until you find incompatible nodes such as if statements, loops, etc. If so, you trigger the rule. |
when can we expect this to be done? |
I'm not active working on Solid or Biome right now, so I would love for someone to pick this up. |
Summary
Implement part of #2438
Source: https://github.com/solidjs-community/eslint-plugin-solid/blob/main/docs/components-return-once.md
Test Plan
There are generally three cases this lint rule needs to cover:
Right now I only have implemented ternaries.