Skip to content

feat(prettier): switch to the new formatter architecture - #944

Merged
leonidaz merged 3 commits into
mainfrom
feat/prettier-plugin-switch
Sep 28, 2026
Merged

leonidaz merged 3 commits into
mainfrom
feat/prettier-plugin-switch

Conversation

@leonidaz

@leonidaz leonidaz commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Make @tsrx/prettier-plugin use the new formatter architecture: ordinary JavaScript, TypeScript, and JSX are printed by Prettier, with custom handling for TSRX-specific syntax. Existing imports and Prettier configuration now resolve to this implementation under the same public package name.

Follows #943's preparatory folder move.

  • Rename packages/tsrx-prettier-plugin to packages/prettier-plugin and delete packages/old-prettier-plugin. Remove the old test project and typecheck path, and rename the new projects and maintenance commands to their final names.
  • Restore the published package metadata: @tsrx/prettier-plugin, current version 0.4.12, public publishing, and author. Remove the temporary private package identity.
  • Preserve the old published CHANGELOG.md byte-for-byte, replacing the temporary package's changelog.
  • Consolidate pending formatter notes into one minor changeset describing the architecture switch and Prettier compatibility. The release plan advances @tsrx/prettier-plugin to 0.5.0.
  • Delete nine superseded formatter-only changesets. Remove the formatter entries and descriptions from 27 mixed changesets while preserving the other packages' release entries and parser/compiler notes. Remove one additional obsolete formatter reference from a core-only note.
  • Reformat 16 scoped-style fixtures with the new formatter so the repository's formatting check passes. The new formatter's implementation is unchanged by this switch.

Validation:

  • Full pnpm test: 9,010 passed, 77 skipped, across 129 test files.
  • Full pnpm format:check: passes.
  • pnpm changeset:check, frozen offline install, and git diff --check: pass.
  • Verified the root, MCP, and website consumers resolve @tsrx/prettier-plugin to the new implementation.
  • Packed the public package and checked its metadata and TSRX formatting from the tarball.
  • Verified the changelog is unchanged and all non-formatter release entries in the mixed changesets are preserved.
  • pnpm typecheck passes all package checks, then fails in the website on the existing Vite/Rolldown MinimalPluginContext/environment type conflict between Vite installations using different @types/node versions. These diagnostics also reproduce on the unchanged pre-switch branch; no new diagnostic was introduced by the switch.

Note

Medium Risk
Replacing the published formatter changes default formatting for all TSRX consumers and may churn CI or editor workflows; scope is mostly packaging and docs, not runtime compiler behavior.

Overview
Ships the Prettier-backed formatter as the public @tsrx/prettier-plugin package by promoting packages/prettier-plugin (formerly the private tsrx-prettier-plugin work) and removing the legacy packages/old-prettier-plugin implementation. Workspace wiring, root typecheck, Vitest projects (prettier-plugin / prettier-plugin-3.6), and pnpm-lock.yaml now point at the new package path while keeping the same npm name, version lineage (0.4.12), and publish metadata.

Release notes are reorganized: a single minor changeset documents the architecture switch (Prettier’s JS/TS printer + TSRX-specific printing, peer prettier >=3.6.0, expected output diffs). Dozens of mixed changesets drop redundant @tsrx/prettier-plugin bullets so formatter behavior is described as parser/core comment attachment where that’s what changed; several formatter-only changesets are deleted.

Repo fixtures and docs are updated to match the new output—especially parentheses around multiline assigned <style> blocks in scoped-style tests—and README/maintenance commands use @tsrx/prettier-plugin / prettier-plugin project names instead of tsrx-prettier-plugin / old-prettier-plugin.

Reviewed by Cursor Bugbot for commit 846d260. Bugbot is set up for automated code reviews on this repo. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant