fix: correct parent typing for rule visitors#172
Conversation
JSONRuleVisitor| //------------------------------------------------------------------------------ | ||
|
|
||
| /** Adds matching `:exit` selectors for all properties of a `RuleVisitor`. */ | ||
| type WithExit<RuleVisitorType extends RuleVisitor> = { |
There was a problem hiding this comment.
I think this should be a shared helper from @eslint/core as all ESLint languages require it.
|
Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update. |
|
@jaymarvelz are you still working on this? There are some outstanding comments to respond to. |
There was a problem hiding this comment.
Hi — as I mentioned in eslint/markdown#571 (review), could you please share a bit more context about this PR and update the PR description to include the bug templates?
I'm having trouble understanding exactly what this PR is fixing.
There was a problem hiding this comment.
The tests currently pass even when I revert the changes in types.ts.
Could we add tests that fail if the change is reverted so we can verify the before-and-after behavior?
| String: (...args) => testVisitor<StringNode>(...args), | ||
| "String:exit": (...args) => testVisitor<StringNode>(...args), | ||
|
|
||
| // Combined selectors allowed |
There was a problem hiding this comment.
| // Combined selectors allowed | |
| // ESQuery selectors allowed |
Just a bit more clearer term: https://github.com/estools/esquery
|
@jaymarvelz are you still working on this? |
|
There has been no reply from the author for more than a month since the last change request, and the related Markdown PR (eslint/markdown#571) has already been closed due to its age, so I'm closing this PR. If you plan to re-submit this PR with a fix, please describe the bug you're encountering using the bug template. |
Prerequisites checklist
What is the purpose of this pull request?
To correct the
JSONRuleVisitortype definitions and improve maintainability by introducing aWithExithelper (copied from eslint/markdown). This ensures:exitselectors are automatically generated for all node types and simplifies visitor type definitions.What changes did you make? (Give an overview)
WithExit<RuleVisitorType>helper type to automatically add:exitvariants.JSONRuleVisitorinterface with a version usingWithExit.Related Issues
Is there anything you'd like reviewers to focus on?