Skip to content

Commit 0d52764

Browse files
authored
fix: format breaks npm and edge case for pnpm #2080 (#2081)
1 parent e00f08e commit 0d52764

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

.changeset/neat-hounds-develop.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-t3-app": patch
3+
---
4+
5+
fixes installation issues with npm and when not installing packages

cli/src/helpers/format.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ export const formatProject = async ({
2121
const spinner = ora("Running format command\n").start();
2222

2323
if (eslint) {
24-
await execa(pkgManager, ["format:write"], {
24+
await execa(pkgManager, ["run", "format:write"], {
2525
cwd: projectDir,
2626
});
2727
} else if (biome) {
28-
await execa(pkgManager, ["check:unsafe"], {
28+
await execa(pkgManager, ["run", "check:unsafe"], {
2929
cwd: projectDir,
3030
});
3131
}

cli/src/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ const main = async () => {
8484

8585
if (!noInstall) {
8686
await installDependencies({ projectDir });
87-
}
8887

89-
await formatProject({
90-
pkgManager,
91-
projectDir,
92-
eslint: packages.includes("eslint"),
93-
biome: packages.includes("biome"),
94-
});
88+
await formatProject({
89+
pkgManager,
90+
projectDir,
91+
eslint: packages.includes("eslint"),
92+
biome: packages.includes("biome"),
93+
});
94+
}
9595

9696
if (!noGit) {
9797
await initializeGit(projectDir);

0 commit comments

Comments
 (0)