-
-
Notifications
You must be signed in to change notification settings - Fork 499
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
💅 Consistent crash on malformed ternary #1695
Comments
The code that you pasted is not valid. Look at the playground, and even Prettier throws an error. And TS too I'm not sure why we don't throw any diagnostic though, that's weird. |
Yeah, that's why I specifically said malformed ternary :D. I managed to narrow down the crash to that specific lint rule, but it happened while I was editing a file and typed in an "empty" ternary like that. |
Yeah, but the issue is not the linter. It's a parser issue :) |
I'll take a look:) |
The parser seems to be working fine, but the issue only reproduces in the production environment🤔 Screen.Recording.2024-02-04.at.16.43.37.mov |
Hey @togami2864 , I took a look at this issue before and have some observations that I hope will be helpful:
I guess you can explore the issue more from here biome/crates/biome_js_semantic/src/events.rs Lines 484 to 487 in ee9b3ac
|
@ah-yu Awesome! Thank you! |
@togami2864 Are you still working on it? If not, I could take a look :) |
How quickly did you fix it 🎉 Thank you! |
Environment information
Rule name
lint/correctness/noUnusedVariables
Playground link
https://biomejs.dev/playground/?lintRules=all&code=dAB5AHAAZQAgAFQAbwBQAGEAcwBjAGEAbABDAGEAcwBlADwAUwAgAGUAeAB0AGUAbgBkAHMAIABzAHQAcgBpAG4AZwA%2BACAAPQAgAFMAIABlAHgAdABlAG4AZABzACAAYAAkAHsAaQBuAGYAZQByACAAUAByAGUAZgBpAHgAfQBgACAAPwAgADoAIAA7AA%3D%3D
Expected result
I'm getting this crash message:
Just as the placeholder for this field says, "It should not throw an error." 😝
Code of Conduct
The text was updated successfully, but these errors were encountered: