-
-
Notifications
You must be signed in to change notification settings - Fork 708
fix(linter/plugins): add comments field to TS type def for Program
#14626
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
fix(linter/plugins): add comments field to TS type def for Program
#14626
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds the comments field to the TypeScript type definition for Program in the Oxlint JS plugins AST, addressing a missing type definition that was causing TypeScript errors when accessing ast.comments.
- Updates the TypeScript code generator to inject a
comments: Comment[]field into thePrograminterface - Imports the
Commenttype alongsideSpanfrom the plugins types module - Removes the
@ts-expect-errorsuppression that was previously needed to access the comments field
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tasks/ast_tools/src/generators/typescript.rs | Modifies the code generator to add comments field to Program interface and import Comment type |
| apps/oxlint/src-js/plugins/source_code.ts | Removes @ts-expect-error suppression now that comments field is properly typed |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Merge activity
|
02f5aea to
5238891
Compare
|
@lilnasy FYI the reason we don't include oxc/crates/oxc_napi/src/comment.rs Lines 3 to 11 in 84b2605
It's the oxc/crates/oxc_ast/src/ast/comment.rs Lines 126 to 127 in 84b2605
This is a bit of a messy situation, but I think it's OK for now. |

#14589 added
commentsfield toProgramin Oxlint JS plugins AST. Add this field to the TS type def forProgram.