-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
fix: forward traversal step.args to visitors
#20253
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
Conversation
✅ Deploy Preview for docs-eslint ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@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. |
|
Sorry I forgot to link the comment from @fasttime: eslint/json#172 (comment) |
|
@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. |
|
Sorry for the trouble. I’ve opened eslint/eslint#20261 with the details. |
|
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. |
nzakas
left a comment
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. Would like another review before merging.
step.args to visitorsstep.args to visitors
mdjermanovic
left a comment
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 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 forwardsstep.argstovisitor.callSync()for both enter and exit phases, falling back to[node]whenargsare not provided. For non-JS languages, the parent node is commonly included as the second element instep.args(i.e.,[node, parent]).fixes #20261
What changes did you make? (Give an overview)
step.argsto visitors inSourceCodeTraverser.traverseSync()for enter/exit phases.step.argsis forwarded.Is there anything you'd like reviewers to focus on?