Skip to content

Conversation

lumirlumir
Copy link
Member

@lumirlumir lumirlumir commented Jun 16, 2025

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-type loc to the getIndexFromLoc method.

Currently, passing null to getIndexFromLoc results in an unrelated error because accessing loc.line throws when loc is null.

So, I’ve updated the error message to more precisely indicate that an incorrect type was passed to the getIndexFromLoc method.

  • Before:

image

  • After:

image

Is there anything you'd like reviewers to focus on?

@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Jun 16, 2025
@eslint-github-bot eslint-github-bot bot added the bug ESLint is working incorrectly label Jun 16, 2025
Copy link

netlify bot commented Jun 16, 2025

Deploy Preview for docs-eslint canceled.

Name Link
🔨 Latest commit bc245ec
🔍 Latest deploy log https://app.netlify.com/projects/docs-eslint/deploys/685ce58755e2220008fa1082

@lumirlumir lumirlumir changed the title fix: handle null loc in getIndexFromLoc method fix: handle null type loc in getIndexFromLoc method Jun 16, 2025
@lumirlumir lumirlumir marked this pull request as ready for review June 17, 2025 09:28
@lumirlumir lumirlumir requested a review from a team as a code owner June 17, 2025 09:28
@lumirlumir lumirlumir marked this pull request as draft June 18, 2025 13:45
@nzakas nzakas moved this from Needs Triage to Implementing in Triage Jun 19, 2025
@lumirlumir lumirlumir marked this pull request as ready for review June 23, 2025 08:56
@lumirlumir lumirlumir requested a review from nzakas June 23, 2025 08:58
@lumirlumir lumirlumir force-pushed the fix-handle-null-loc-in-get-index-from-loc-method branch from a0312a4 to dbde956 Compare June 25, 2025 06:13
@lumirlumir lumirlumir added the accepted There is consensus among the team that this change meets the criteria for inclusion label Jun 25, 2025
@lumirlumir lumirlumir force-pushed the fix-handle-null-loc-in-get-index-from-loc-method branch from dbde956 to bc245ec Compare June 26, 2025 06:15
@lumirlumir
Copy link
Member Author

lumirlumir commented Jun 26, 2025

I’ve reverted the latest changes based on the comments.

Copy link
Contributor

@snitin315 snitin315 left a 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

@snitin315 snitin315 moved this from Implementing to Second Review Needed in Triage Jun 26, 2025
Copy link
Member

@mdjermanovic mdjermanovic left a 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

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

@nzakas nzakas merged commit 6a0f164 into main Jun 26, 2025
52 checks passed
@nzakas nzakas deleted the fix-handle-null-loc-in-get-index-from-loc-method branch June 26, 2025 19:00
@github-project-automation github-project-automation bot moved this from Second Review Needed to Complete in Triage Jun 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

4 participants