Skip to content

refactor(linter/plugins): split TSDown plugins into separate files#20304

Merged
graphite-app[bot] merged 1 commit intomainfrom
om/03-12-refactor_linter_plugins_split_tsdown_plugins_into_separate_files
Mar 12, 2026
Merged

refactor(linter/plugins): split TSDown plugins into separate files#20304
graphite-app[bot] merged 1 commit intomainfrom
om/03-12-refactor_linter_plugins_split_tsdown_plugins_into_separate_files

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Mar 12, 2026

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.

Copy link
Member Author

overlookmotel commented Mar 12, 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 changes, fast-track this PR to the front of 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.

@github-actions github-actions bot added A-linter Area - Linter A-cli Area - CLI C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Mar 12, 2026
@overlookmotel overlookmotel marked this pull request as ready for review March 12, 2026 19:08
@overlookmotel overlookmotel requested a review from camc314 as a code owner March 12, 2026 19:08
Copilot AI review requested due to automatic review settings March 12, 2026 19:08
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

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.ts into apps/oxlint/tsdown_plugins/*.
  • Added a shared parse() helper for plugin AST parsing.
  • Added @oxc-project/types (dev dependency) to type the parsed AST Program.

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

@overlookmotel overlookmotel self-assigned this Mar 12, 2026
@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Mar 12, 2026
@graphite-app
Copy link
Contributor

graphite-app bot commented Mar 12, 2026

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.
@graphite-app graphite-app bot force-pushed the om/03-12-refactor_linter_plugins_split_tsdown_plugins_into_separate_files branch from 1f54c53 to c6cbe42 Compare March 12, 2026 19:23
@graphite-app graphite-app bot merged commit c6cbe42 into main Mar 12, 2026
19 checks passed
@graphite-app graphite-app bot deleted the om/03-12-refactor_linter_plugins_split_tsdown_plugins_into_separate_files branch March 12, 2026 19:36
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants