Skip to content

Commit c56f78a

Browse files
fix: sort compilerOptions in tsconfig.json (#2104)
## PR Checklist - [x] Addresses an existing open issue: fixes #2092 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/create-typescript-app/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [ ] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/create-typescript-app/blob/main/.github/CONTRIBUTING.md) were taken ## Overview 🎁
1 parent 92e711d commit c56f78a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/blocks/blockTypeScript.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ describe("blockTypeScript", () => {
298298
},
299299
],
300300
"files": {
301-
"tsconfig.json": "{"compilerOptions":{"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":"NodeNext","moduleResolution":"NodeNext","noEmit":true,"resolveJsonModule":true,"skipLibCheck":true,"strict":true,"target":"ES2022","strictBindCallApply":false},"include":["src"]}",
301+
"tsconfig.json": "{"compilerOptions":{"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":"NodeNext","moduleResolution":"NodeNext","noEmit":true,"resolveJsonModule":true,"skipLibCheck":true,"strict":true,"strictBindCallApply":false,"target":"ES2022"},"include":["src"]}",
302302
},
303303
}
304304
`);

src/blocks/blockTypeScript.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sortKeys from "sort-keys";
12
import { CompilerOptionsSchema } from "zod-tsconfig";
23

34
import { base } from "../base.js";
@@ -121,7 +122,7 @@ export * from "./types.js";
121122
],
122123
files: {
123124
"tsconfig.json": JSON.stringify({
124-
compilerOptions: {
125+
compilerOptions: sortKeys({
125126
declaration: true,
126127
declarationMap: true,
127128
esModuleInterop: true,
@@ -133,7 +134,7 @@ export * from "./types.js";
133134
strict: true,
134135
target: "ES2022",
135136
...compilerOptions,
136-
},
137+
}),
137138
include: ["src"],
138139
}),
139140
},

0 commit comments

Comments
 (0)