feat: add CustomRuleVisitorWithExit type to @eslint/plugin-kit#351
Merged
lumirlumir merged 3 commits intomainfrom Jan 16, 2026
Merged
feat: add CustomRuleVisitorWithExit type to @eslint/plugin-kit#351lumirlumir merged 3 commits intomainfrom
CustomRuleVisitorWithExit type to @eslint/plugin-kit#351lumirlumir merged 3 commits intomainfrom
Conversation
9 tasks
This was referenced Jan 7, 2026
fasttime
reviewed
Jan 10, 2026
Member
There was a problem hiding this comment.
We also need to export CustomRuleVisitorWithExit from packages/plugin-it/source-code.js, probably like this:
/** @typedef {import("@eslint/core").RuleVisitor} RuleVisitor */
/**
* @typedef {import("./types.ts").CustomRuleVisitorWithExit<RuleVisitorType>} CustomRuleVisitorWithExit<RuleVisitorType>
* @template {RuleVisitor} RuleVisitorType
*/The next step is ensuring that packages/plugin-kit/dist/cjs/index.d.cts references import("./types.cts") instead of import("./types.ts"). This kind of substitution is already being done in tools/build-cts.js, but only for static imports:
Lines 27 to 30 in f8df139
fasttime
approved these changes
Jan 12, 2026
Member
fasttime
left a comment
There was a problem hiding this comment.
LGTM, thanks! Leaving open for a second review.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prerequisites checklist
What is the purpose of this pull request?
This PR adds a
CustomRuleVisitorWithExittype to the@eslint/plugin-kitpackage to address the need for a shared type that can generate exit selectors for rule visitors. Currently, each language plugin (JavaScript, JSON, CSS, Markdown) has to reimplement this same helper type separately.What changes did you make? (Give an overview)
CustomRuleVisitorWithExittype.CustomRuleVisitorWithExitRelated Issues
Fixes #318
Is there anything you'd like reviewers to focus on?