Skip to content

fix(prettier): preserve generic type declarations and modifiers - #139

Merged
leonidaz merged 1 commit into
tsrx-org:mainfrom
crutchcorn:fix-prettier-generic-types
Sep 20, 2026
Merged

leonidaz merged 1 commit into
tsrx-org:mainfrom
crutchcorn:fix-prettier-generic-types

Conversation

@crutchcorn

@crutchcorn crutchcorn commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

While working on TanStack TSRX code, I noticed the Prettier plugin removed many relevant type arguments. This PR fixes that.


Note

Low Risk
Formatter-only output changes in the Prettier plugin; no runtime, auth, or data-path impact.

Overview
Fixes the TSRX Prettier plugin dropping TypeScript generic syntax when formatting type positions that were previously printed without their angle-bracket lists.

Function and constructor types now emit typeParameters before the parameter list (e.g. <K extends keyof T>(...) => ... and new <T>(...) => ..., including abstract new).

Individual type parameters now retain const, in, and out modifiers in printTSTypeParameter, alongside existing extends / default handling.

Regression tests assert byte-stable formatting for generic callables, generic constructors, variance annotations, and const type parameters.

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

@vercel

vercel Bot commented Sep 20, 2026

Copy link
Copy Markdown

@crutchcorn is attempting to deploy a commit to the Ripple Team Team on Vercel.

A member of the Team first needs to authorize it.

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.

2 participants