Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jaymarvelz
Copy link
Contributor

@jaymarvelz jaymarvelz commented Oct 28, 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 is the purpose of this pull request?

The purpose of this pull request is to enable visitors to receive the full set of arguments provided by traversal steps, not just the node. Specifically, SourceCodeTraverser.traverseSync() now forwards step.args to visitor.callSync() for both enter and exit phases, falling back to [node] when args are not provided. For non-JS languages, the parent node is commonly included as the second element in step.args (i.e., [node, parent]).

fixes #20261

What changes did you make? (Give an overview)

  • Forward step.args to visitors in SourceCodeTraverser.traverseSync() for enter/exit phases.
  • Add unit test to verify that step.args is forwarded.

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

@jaymarvelz jaymarvelz requested a review from a team as a code owner October 28, 2025 14:13
@eslint-github-bot eslint-github-bot bot added the feature This change adds a new feature to ESLint label Oct 28, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Oct 28, 2025
@netlify
Copy link

netlify bot commented Oct 28, 2025

Deploy Preview for docs-eslint ready!

Name Link
🔨 Latest commit ceea6c6
🔍 Latest deploy log https://app.netlify.com/projects/docs-eslint/deploys/6900cf9423250600088a05a5
😎 Deploy Preview https://deploy-preview-20253--docs-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added the core Relates to ESLint's core APIs and features label Oct 28, 2025
@nzakas nzakas moved this from Needs Triage to Triaging in Triage Oct 28, 2025
@nzakas
Copy link
Member

nzakas commented Oct 28, 2025

@jaymarvelz is this related to an issue? If so, please reference it; if not, please open one and describe the problem you're trying to solve.

@jaymarvelz
Copy link
Contributor Author

Sorry I forgot to link the comment from @fasttime: eslint/json#172 (comment)

@nzakas
Copy link
Member

nzakas commented Oct 29, 2025

@jaymarvelz thanks. Can you open an issue in this repo describing the problem? It's just really difficult to ask people to dig through a different conversation to find the reason for a PR.

@jaymarvelz
Copy link
Contributor Author

Sorry for the trouble. I’ve opened eslint/eslint#20261 with the details.

@nzakas
Copy link
Member

nzakas commented Oct 31, 2025

Thanks! No worries, we just like to have issues for non-obvious things so we can discuss if the behavior is intended or not before making a change. In this case, there's agreement that this is a bug that should be fixed.

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. Would like another review before merging.

@nzakas nzakas changed the title feat: forward traversal step.args to visitors fix: forward traversal step.args to visitors Oct 31, 2025
@eslint-github-bot eslint-github-bot bot added the bug ESLint is working incorrectly label Oct 31, 2025
@mdjermanovic mdjermanovic added contributor pool accepted There is consensus among the team that this change meets the criteria for inclusion labels Oct 31, 2025
@mdjermanovic mdjermanovic moved this from Triaging to Implementing in Triage Oct 31, 2025
@mdjermanovic mdjermanovic moved this from Implementing to Second Review Needed in Triage Oct 31, 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!

@mdjermanovic mdjermanovic merged commit 15f5c7c into eslint:main Oct 31, 2025
32 checks passed
@github-project-automation github-project-automation bot moved this from Second Review Needed to Complete in Triage Oct 31, 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 contributor pool core Relates to ESLint's core APIs and features feature This change adds a new feature to ESLint

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

Bug: Visitors should receive all arguments from VisitNodeStep.args

3 participants