You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This adds the standalone Prettier choice requested in #510. Use --toolchain prettier during creation or tanstack add prettier in an existing generated project. It formats files and checks formatting without installing a linter.
AI review notes:
React and Solid use the existing toolchain metadata and Prettier ^3.8.1 range already used by the ESLint toolchain. The new choice includes formatter/check scripts, editable configuration, generated-output/lockfile ignores and instructions using the selected package manager. Defaults remain unchanged.
Six blocking generated-app cases cover React and Solid, standard Vite projects with pnpm, blank Rsbuild projects with npm, and adding Prettier to existing blank Vite projects. Each builds and type-checks, confirms no ESLint/Biome dependency or lint script is introduced, formats successfully, rejects deliberately unformatted source, then formats and checks successfully again.
This is the standalone formatter part of #510. Ultracite presets, Oxfmt and the separate Oxlint proposal remain open. No provider services or external infrastructure are involved.
Validation: normal hooks passed all 10 workspace builds, lint, 569 unit tests and all 20 blocking browser cases. The CLI dist JavaScript is unchanged; create dist JavaScript is +14,215 raw bytes and +3,764 gzip bytes, within applicable budgets. These are CLI/core artifact figures, not application client bundle measurements. Published Prettier 3.8.1 metadata declares Node >=14 and no runtime dependencies or install scripts.
Summary by CodeRabbit
New Features
Added a standalone Prettier toolchain for React and Solid apps, available during project creation or through tanstack add prettier.
Generated projects include format and check commands, a consistent Prettier configuration, and sensible default exclusions. This toolchain does not add a linter.
Documentation
Documented the formatting commands and configuration for both frameworks.
No actionable comments were generated in the recent review.
Walkthrough
React and Solid project templates now provide a standalone Prettier toolchain with formatting and check scripts, Prettier configuration, ignore patterns, and setup metadata. The toolchain can be selected during project creation or added to an existing project. End-to-end tests cover both frameworks and three app modes.
Changes: Standalone Prettier toolchain
Layer / File(s)
Summary
React and Solid toolchain definitions packages/create/src/frameworks/{react,solid}/toolchains/prettier/..., .changeset/standalone-prettier-toolchain.md
Both templates define Prettier format and check scripts, a Prettier configuration and ignore file, and metadata that excludes the linter category. The READMEs document the commands and state that the toolchain does not add a linter. The changeset describes the available invocation options.
The end-to-end test checks React and Solid apps in standard, blank, and existing-app modes. It verifies the Prettier dependency and scripts, then checks formatting behavior before and after adding blank lines to a route file.
sequenceDiagram
participant SmokeTest
participant AppFixture
participant PackageScripts
participant Prettier
SmokeTest->>AppFixture: Create React or Solid app fixture
AppFixture-->>SmokeTest: Return project path
SmokeTest->>PackageScripts: Run format and check
PackageScripts->>Prettier: Execute Prettier commands
Prettier-->>SmokeTest: Formatting check succeeds
SmokeTest->>SmokeTest: Add blank lines to a route file
SmokeTest->>PackageScripts: Run check
PackageScripts->>Prettier: Execute prettier --check .
Prettier-->>SmokeTest: Check exits with code 1
SmokeTest->>PackageScripts: Run format, then check
PackageScripts->>Prettier: Format files and check formatting
Prettier-->>SmokeTest: Formatting check succeeds
Loading
Possibly related issues
TanStack/cli issue 510 requests standalone Prettier as a formatter option. This change adds the standalone option for project creation and existing projects.
Merge Risk: Minimal · up to 006b8
This adds an opt-in standalone Prettier toolchain without changing defaults. No concrete merge-blocking risk was found.
Pre-merge checks: 5
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly describes the main change: a standalone Prettier toolchain for create.
Docstring Coverage
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 3 files. (9 skipped: 9 unsupported.)
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Warning
Some tools did not complete. Review the errors below.
ESLint
If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
packages/cli/tests-e2e/prettier-smoke.spec.ts
Parsing error: "parserOptions.project" has been provided for @typescript-eslint/parser.
The file was not found in any of the provided project(s): packages/cli/tests-e2e/prettier-smoke.spec.ts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds the standalone Prettier choice requested in #510. Use
--toolchain prettierduring creation ortanstack add prettierin an existing generated project. It formats files and checks formatting without installing a linter.Summary by CodeRabbit
tanstack add prettier.formatandcheckcommands, a consistent Prettier configuration, and sensible default exclusions. This toolchain does not add a linter.