Skip to content
Source
Sign inSign up
TanStack/cli

feat(create): add standalone Prettier toolchain #571

Mergedtannerlinsleymerged 1 commit intomain fromrefs/pull/571/headmerged by tannerlinsley

Showing 12 changed files with 62 additions and 0 deletions (loading 9).

x
0 of 12 viewed, 12 left
5 additions and 0 deletions.changeset/standalone-prettier-toolchain.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/create': minor
+---
+​
+Add a standalone Prettier toolchain for React and Solid apps, available with `--toolchain prettier` or `tanstack add prettier`.
51 additions and 0 deletionspackages/cli/tests-e2e/prettier-smoke.spec.tsAdded
View file
@@ -0,0 +1,51 @@
+import { execFile } from 'node:child_process'
+import { appendFile, readFile } from 'node:fs/promises'
+import { join } from 'node:path'
+import { promisify } from 'node:util'
+import { expect, test } from '@playwright/test'
+import { createReactAppFixture } from './helpers'
+​
+const execFileAsync = promisify(execFile)
+​
+for (const framework of ['react', 'solid'] as const) {
+ for (const mode of ['standard', 'blank', 'existing'] as const) {
+ test(`@blocking formats a ${mode} ${framework} app with standalone Prettier`, async () => {
+ const packageManager = mode === 'blank' ? 'npm' : 'pnpm'
+ const fixture = await createReactAppFixture({
+ appName: `${framework}-prettier-${mode}`,
+ framework,
+ bundler: mode === 'blank' ? 'rsbuild' : 'vite',