refactor(linter/plugins): split TSDown plugins into separate files#20304
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.
Pull request overview
Refactors the apps/oxlint TSDown build configuration by extracting the custom Rolldown/TSDown transform plugins into dedicated modules, keeping tsdown.config.ts smaller and easier to extend as more plugins are added.
Changes:
- Split the “replace globals” and “replace asserts” TSDown plugins out of
tsdown.config.tsintoapps/oxlint/tsdown_plugins/*. - Added a shared
parse()helper for plugin AST parsing. - Added
@oxc-project/types(dev dependency) to type the parsed ASTProgram.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Locks the newly added @oxc-project/types dependency version. |
| apps/oxlint/package.json | Adds @oxc-project/types to devDependencies for AST typing in build plugins. |
| apps/oxlint/tsdown.config.ts | Replaces inline plugin implementations with imports from tsdown_plugins/. |
| apps/oxlint/tsdown_plugins/utils.ts | Introduces shared parse() helper around oxc-parser parsing. |
| apps/oxlint/tsdown_plugins/replace_globals.ts | Extracted plugin that rewrites global property accesses to imported top-level vars. |
| apps/oxlint/tsdown_plugins/replace_asserts.ts | Extracted plugin that removes debug/type assertion imports and call sites in release builds. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Merge activity
|
…20304) Pure refactor. TSDown config had got very large with the custom plugins to replace `debugAssert` calls, and hoist globals vars to top level. A PR to follow will make the situation worse, as it adds another plugin. Move the plugins into separate files, to bring the TSDown config back to a manageable size. This PR does not alter the plugin code, just moves it.
1f54c53 to
c6cbe42
Compare

Pure refactor. TSDown config had got very large with the custom plugins to replace
debugAssertcalls, and hoist globals vars to top level. A PR to follow will make the situation worse, as it adds another plugin.Move the plugins into separate files, to bring the TSDown config back to a manageable size.
This PR does not alter the plugin code, just moves it.