diff --git a/.changeset/thirty-hairs-crash.md b/.changeset/thirty-hairs-crash.md new file mode 100644 index 000000000..933a5c41e --- /dev/null +++ b/.changeset/thirty-hairs-crash.md @@ -0,0 +1,5 @@ +--- +"create-eth": patch +--- + +Format package.json files diff --git a/src/utils/merge-package-json.ts b/src/utils/merge-package-json.ts index 3d2d5abbc..5a65f27c8 100644 --- a/src/utils/merge-package-json.ts +++ b/src/utils/merge-package-json.ts @@ -14,7 +14,9 @@ export function mergePackageJson(targetPackageJsonPath: string, secondPackageJso const mergedPkgStr = mergeJsonStr.default(targetPackageJson, secondPackageJson); - fs.writeFileSync(targetPackageJsonPath, mergedPkgStr, "utf8"); + const formattedPkgStr = JSON.stringify(JSON.parse(mergedPkgStr), null, 2); + + fs.writeFileSync(targetPackageJsonPath, formattedPkgStr, "utf8"); if (isDev) { const devStr = `TODO: write relevant information for the contributor`; fs.writeFileSync(`${targetPackageJsonPath}.dev`, devStr, "utf8");