Skip to content

docs(linter/plugins): move comment about "bivariance hack" into generated code#20082

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/03-06-docs_linter_plugins_move_comment_about_bivariance_hack_into_generated_code
Mar 6, 2026
Merged

docs(linter/plugins): move comment about "bivariance hack" into generated code#20082
graphite-app[bot] merged 1 commit intomainfrom
om/03-06-docs_linter_plugins_move_comment_about_bivariance_hack_into_generated_code

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Mar 6, 2026

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 about the shortcomings of the hack approach.

Copy link
Member Author

overlookmotel commented Mar 6, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@overlookmotel overlookmotel marked this pull request as ready for review March 6, 2026 17:19
Copilot AI review requested due to automatic review settings March 6, 2026 17:19
@overlookmotel overlookmotel requested a review from camc314 as a code owner March 6, 2026 17:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 VisitorObject typings.
  • 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 camc314 added the 0-merge Merge with Graphite Merge Queue label Mar 6, 2026
Copy link
Contributor

camc314 commented Mar 6, 2026

Merge activity

  • Mar 6, 5:31 PM UTC: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 6, 6:12 PM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.
  • Mar 6, 6:27 PM UTC: camc314 added this pull request to the Graphite merge queue.
  • Mar 6, 6:34 PM UTC: Merged by the Graphite merge queue.

@overlookmotel overlookmotel force-pushed the om/03-06-docs_linter_plugins_move_comment_about_bivariance_hack_into_generated_code branch from bfccf69 to 6e10dac Compare March 6, 2026 17:37
@overlookmotel overlookmotel force-pushed the om/03-06-fix_linter_plugins_fix_types_for_walkprogram_and_walkprogramwithcfg_ branch from 3a2b46c to 07be1dd Compare March 6, 2026 17:37
@graphite-app graphite-app bot changed the base branch from om/03-06-fix_linter_plugins_fix_types_for_walkprogram_and_walkprogramwithcfg_ to graphite-base/20082 March 6, 2026 17:40
@overlookmotel overlookmotel force-pushed the om/03-06-docs_linter_plugins_move_comment_about_bivariance_hack_into_generated_code branch from 6e10dac to b434c6d Compare March 6, 2026 17:56
@overlookmotel overlookmotel changed the base branch from graphite-base/20082 to om/03-06-fix_linter_plugins_fix_types_for_walkprogram_and_walkprogramwithcfg_ March 6, 2026 17:56
@graphite-app graphite-app bot changed the base branch from om/03-06-fix_linter_plugins_fix_types_for_walkprogram_and_walkprogramwithcfg_ to graphite-base/20082 March 6, 2026 18:04
@camc314 camc314 force-pushed the graphite-base/20082 branch from 4a48042 to 92cfb14 Compare March 6, 2026 18:12
@camc314 camc314 force-pushed the om/03-06-docs_linter_plugins_move_comment_about_bivariance_hack_into_generated_code branch from b434c6d to 50c0196 Compare March 6, 2026 18:12
@graphite-app graphite-app bot changed the base branch from graphite-base/20082 to main March 6, 2026 18:12
@overlookmotel overlookmotel force-pushed the om/03-06-docs_linter_plugins_move_comment_about_bivariance_hack_into_generated_code branch from 50c0196 to caf1612 Compare March 6, 2026 18:19
…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.
@graphite-app graphite-app bot force-pushed the om/03-06-docs_linter_plugins_move_comment_about_bivariance_hack_into_generated_code branch from caf1612 to 2c0010a Compare March 6, 2026 18:27
@graphite-app graphite-app bot merged commit 2c0010a into main Mar 6, 2026
19 checks passed
@graphite-app graphite-app bot deleted the om/03-06-docs_linter_plugins_move_comment_about_bivariance_hack_into_generated_code branch March 6, 2026 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0-merge Merge with Graphite Merge Queue A-ast-tools Area - AST tools A-cli Area - CLI A-linter Area - Linter A-linter-plugins Area - Linter JS plugins C-docs Category - Documentation. Related to user-facing or internal documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants