Skip to content

Commit 2d7e436

Browse files
author
Josh Goldberg
authored
Used tsc --showConfig instead of cat for --typescript configs (#90)
1 parent 9b64610 commit 2d7e436

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/input/findTypeScriptConfiguration.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe("findTypeScriptConfiguration", () => {
2626
await findTypeScriptConfiguration(dependencies, undefined);
2727

2828
// Assert
29-
expect(dependencies.exec).toHaveBeenLastCalledWith(`cat "./tsconfig.json"`);
29+
expect(dependencies.exec).toHaveBeenLastCalledWith(`tsc --showConfig -p "./tsconfig.json"`);
3030
});
3131

3232
it("includes a configuration file in the TypeScript command when one is provided", async () => {
@@ -38,7 +38,9 @@ describe("findTypeScriptConfiguration", () => {
3838
await findTypeScriptConfiguration(dependencies, config);
3939

4040
// Assert
41-
expect(dependencies.exec).toHaveBeenLastCalledWith(`cat "./custom/tsconfig.json"`);
41+
expect(dependencies.exec).toHaveBeenLastCalledWith(
42+
`tsc --showConfig -p "./custom/tsconfig.json"`,
43+
);
4244
});
4345

4446
it("applies TypeScript defaults when none are provided", async () => {

src/input/findTypeScriptConfiguration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const findTypeScriptConfiguration = async (
1919
): Promise<TypeScriptConfiguration | Error> => {
2020
const rawConfiguration = await findConfiguration<TypeScriptConfiguration>(
2121
dependencies.exec,
22-
"cat",
22+
"tsc --showConfig -p",
2323
config || "./tsconfig.json",
2424
);
2525

0 commit comments

Comments
 (0)