-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
fix: handle null
type loc
in getIndexFromLoc
method
#19862
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: handle null
type loc
in getIndexFromLoc
method
#19862
Conversation
✅ Deploy Preview for docs-eslint canceled.
|
null
loc
in getIndexFromLoc
methodnull
type loc
in getIndexFromLoc
method
a0312a4
to
dbde956
Compare
dbde956
to
bc245ec
Compare
I’ve reverted the latest changes based on the comments. |
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.
LGTM, thanks!
Leaving it open for @mdjermanovic & @nzakas
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.
LGTM, thanks! Leaving it open for @nzakas
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.
LGTM. Thanks.
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[x] Add something to the core
[ ] Other, please explain:
What changes did you make? (Give an overview)
Hello,
In this PR, I've added handling logic for
null
-typeloc
to thegetIndexFromLoc
method.Currently, passing
null
togetIndexFromLoc
results in an unrelated error because accessingloc.line
throws whenloc
isnull
.So, I’ve updated the error message to more precisely indicate that an incorrect type was passed to the
getIndexFromLoc
method.Is there anything you'd like reviewers to focus on?