-
-
Notifications
You must be signed in to change notification settings - Fork 495
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
fix(analyze/js): fix bindings in bogus imports not being detected as imports #4578
fix(analyze/js): fix bindings in bogus imports not being detected as imports #4578
Conversation
Parser conformance results onjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
I think we do want to run rules on files that have bogus nodes, because bogus states are to be expected while the user is typing and we don't want diagnostics to temporarily disappear just because they are temporarily in an invalid syntax state.
Sometimes having a more specific bogus node can indeed help the error recovery become more resilient. But if the change you made now already resolves the issue, my guess is that's it's not needed here? This is something @denbezrukov is usually quite knowledgeable about, if I'm not mistaken. |
Technically, sure, to resolve the issue. But I want to make sure we resolve this with a more preventative measure to make sure this doesn't pop up again. Ultimately, this issue was caused by an assumption (as shown by usage of I don't think I have the bandwidth right now to add the node, but I could write up a task detailed enough for someone else to pick up. |
Out of curiosity, can't we remove the |
Yup, could do that too. I'll go ahead and add that to this PR. |
db1a4e4
to
a723d56
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! We should update the changelog and - if possible - add a test with the code coming from the issue
a723d56
to
883cca5
Compare
883cca5
to
389c0bc
Compare
CodSpeed Performance ReportMerging #4578 will not alter performanceComparing Summary
|
Summary
This fix attempts to fix #4568 such that the same issue won't pop up in other lint rules.
I suppose a better fix could be to not evaluate linter rules if the file has parsing errors. Would it be better to add a
JS_BOGUS_IMPORT
instead?fixes #4568
Test Plan
Tested it manually against the sample in the issue.