Skip to content

Commit

Permalink
Fix warning message json-format suggestion to proper syntax
Browse files Browse the repository at this point in the history
The warning message appears for example as "Use --json to see the list
of exports TypeScript can see but Node.js cannot." However, passing
`--json` leads to an error: `error: unknown option '--json'`

Per `--help` argument definition, the correct syntax is `-f json` or
`--format json`, which I confirmed both worked for me.
  • Loading branch information
sjdemartini committed Sep 15, 2024
1 parent 035e965 commit 66ada51
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/kind-ducks-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@arethetypeswrong/cli": patch
---

Fix warning message json-format suggestion to use proper syntax
2 changes: 1 addition & 1 deletion packages/cli/src/render/typed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export async function typed(
const summaryTexts = Object.keys(grouped).map((kind) => {
const info = problemKindInfo[kind as core.ProblemKind];
const description = marked(
`${info.description}${info.details ? ` Use \`--json\` to see ${info.details}.` : ""} ${info.docsUrl}`,
`${info.description}${info.details ? ` Use \`-f json\` to see ${info.details}.` : ""} ${info.docsUrl}`,
);
return `${emoji ? `${info.emoji} ` : ""}${description}`;
});
Expand Down

0 comments on commit 66ada51

Please sign in to comment.