refactor(linter/plugins): move type defs into visitor.ts#16833
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
The refactor is clean, but it likely changes the public type API: CompiledVisitorEntry was exported from types.ts and is now private in visitor.ts. If any external module relied on that export, this becomes a breaking change despite the stated intent of a pure move. Either re-export CompiledVisitorEntry (and potentially other moved types) or explicitly treat them as internal and update any downstream imports.
Summary of changes
Summary
This PR is a pure type-location refactor around visitor compilation types.
- Moved visitor-compilation types from
types.ts→visitor.ts:VisitFnEnterExitCompiledVisitorEntry
- Updated imports accordingly in:
apps/oxlint/src-js/plugins/selector.ts(now importsVisitFnfromvisitor.ts)apps/oxlint/test/compile_visitor.test.ts(now importsEnterExit/VisitFnfromvisitor.ts)
- Trimmed
apps/oxlint/src-js/plugins/types.tsto keep only the shared/public plugin types (Node, hooks, etc.).
No behavioral/runtime logic changes are shown in the diff—this is a type relocation and import rewiring.
There was a problem hiding this comment.
Pull request overview
This PR refactors TypeScript type definitions related to visitor compilation by moving them from types.ts into visitor.ts, improving code organization without changing functionality. The types VisitFn, EnterExit, and CompiledVisitorEntry are relocated to be closer to their usage context in the visitor compilation logic.
Key Changes
- Moved visitor-specific type definitions (
VisitFn,EnterExit,CompiledVisitorEntry) fromtypes.tstovisitor.ts - Updated import statements across affected files to reflect the new type locations
- Maintained proper export visibility (public vs private types)
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| apps/oxlint/src-js/plugins/types.ts | Removed three visitor-related type definitions (VisitFn, EnterExit, CompiledVisitorEntry) |
| apps/oxlint/src-js/plugins/visitor.ts | Added the three visitor-related type definitions with appropriate visibility (exported vs internal) |
| apps/oxlint/src-js/plugins/selector.ts | Updated import to get VisitFn from visitor.ts instead of types.ts |
| apps/oxlint/test/compile_visitor.test.ts | Updated imports to get VisitFn and EnterExit from visitor.ts instead of types.ts |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge activity
|
Pure refactor. Move TS type defs related to visitor compilation from `types.ts` into `visitor.ts`. Does not change the types in any way, only moves them.
8b347c9 to
274594e
Compare

Pure refactor. Move TS type defs related to visitor compilation from
types.tsintovisitor.ts. Does not change the types in any way, only moves them.