docs(linter/plugins): move comment about "bivariance hack" into generated code#20082
Merged
graphite-app[bot] merged 1 commit intomainfrom Mar 6, 2026
Conversation
This was referenced Mar 6, 2026
This was referenced Mar 6, 2026
Member
Author
Contributor
There was a problem hiding this comment.
Pull request overview
Moves the explanatory comment about the TypeScript “bivariance hack” from the Rust code generator into the generated visitor.d.ts, where plugin authors will actually encounter the type, and adds a link explaining drawbacks.
Changes:
- Embed the “bivariance hack” explanation + references directly in the generated
VisitorObjecttypings. - Remove the now-redundant generator-side comment.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tasks/ast_tools/src/generators/estree_visit.rs | Emits the new explanatory comments into the generated visitor.d.ts output. |
| apps/oxlint/src-js/generated/visitor.d.ts | Includes the new top-of-file comments explaining the bivariance hack and linking to downsides. |
camc314
approved these changes
Mar 6, 2026
Contributor
Merge activity
|
bfccf69 to
6e10dac
Compare
3a2b46c to
07be1dd
Compare
6e10dac to
b434c6d
Compare
07be1dd to
4a48042
Compare
4a48042 to
92cfb14
Compare
b434c6d to
50c0196
Compare
50c0196 to
caf1612
Compare
…ated code (#20082) Follow-on after #20065. That PR added a comment about the "bivariance hack", but that comment was in the `ast_tools` codegen. Move the comment into the generated code, as that's what people will be looking at when they ask themselves "what the hell is this thing?". Also add a link to [my comment](#18154 (comment)) about the shortcomings of the hack approach.
caf1612 to
2c0010a
Compare
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.

Follow-on after #20065.
That PR added a comment about the "bivariance hack", but that comment was in the
ast_toolscodegen.Move the comment into the generated code, as that's what people will be looking at when they ask themselves "what the hell is this thing?". Also add a link to my comment about the shortcomings of the hack approach.