-
-
Notifications
You must be signed in to change notification settings - Fork 15
fix: correct parent typing for rule visitors #172
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
base: main
Are you sure you want to change the base?
Conversation
JSONRuleVisitor| //------------------------------------------------------------------------------ | ||
|
|
||
| /** Adds matching `:exit` selectors for all properties of a `RuleVisitor`. */ | ||
| type WithExit<RuleVisitorType extends RuleVisitor> = { |
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.
I think this should be a shared helper from @eslint/core as all ESLint languages require it.
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.
Opened eslint/rewrite#318
|
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| // Combined selectors allowed | |
| // ESQuery selectors allowed |
Just a bit more clearer term: https://github.com/estools/esquery
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?