-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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] Null check rootNode
before calling getScope
with it
#3762
Conversation
rootNode
before calling getScope
with itrootNode
before calling getScope
with it
Thanks - we'd need a regression test in order to land this tho. |
@ljharb I've attempted to add some regression tests by trying to find a minimal reproduction. I think the issue relates to using I get the expected failure without the nullcheck: |
c37344b
to
f877a50
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3762 +/- ##
==========================================
- Coverage 97.79% 97.76% -0.04%
==========================================
Files 134 134
Lines 9613 9614 +1
Branches 3486 3487 +1
==========================================
- Hits 9401 9399 -2
- Misses 212 215 +3 ☔ View full report in Codecov by Sentry. |
I see that code coverage is failing on some indirect changes related to code beneath a |
@crnhrv that PR seems to be in v5 of the parser, but we still support down to v2 |
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.
wonderful, thanks! don't worry about the coverage.
Cool, thanks for the help. Will leave it with you then |
I'm getting this error while linting some valid React/TS code after upgrading to the latest version (
7.34.2
):Stack trace
I don't really understand enough about the codebase to say whether this is the correct fix, or if this really should be passing in
node
instead ofrootNode
togetScope
or something like that. This resolves the immediate issue for me at least and seemed reasonable to check the value is valid before it tries to call something that requires it.