Skip to content

Commit 72707d0

Browse files
committed
Making the linter happy
1 parent 9ba9603 commit 72707d0

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

packages/openapi-typescript/src/lib/ts.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -389,19 +389,11 @@ export function tsEnumMember(value: string | number, metadata: { name?: string;
389389
}
390390

391391
const trimmedDescription = metadata.description?.trim();
392-
if (trimmedDescription === undefined
393-
|| trimmedDescription === null
394-
|| trimmedDescription === ""
395-
) {
392+
if (trimmedDescription === undefined || trimmedDescription === null || trimmedDescription === "") {
396393
return member;
397394
}
398395

399-
return ts.addSyntheticLeadingComment(
400-
member,
401-
ts.SyntaxKind.SingleLineCommentTrivia,
402-
` ${trimmedDescription}`,
403-
true,
404-
);
396+
return ts.addSyntheticLeadingComment(member, ts.SyntaxKind.SingleLineCommentTrivia, ` ${trimmedDescription}`, true);
405397
}
406398

407399
/** Create an intersection type */

packages/openapi-typescript/test/lib/ts.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,11 @@ describe("tsEnum", () => {
278278
tsEnum(
279279
".Error.code.",
280280
[100, 101, 102],
281-
[{ name: "Unauthorized", description: "User is unauthorized" }, { name: "NotFound", description: "" }, { name: "Value102", description: null }],
281+
[
282+
{ name: "Unauthorized", description: "User is unauthorized" },
283+
{ name: "NotFound", description: "" },
284+
{ name: "Value102", description: null },
285+
],
282286
),
283287
).trim(),
284288
).toBe(`enum ErrorCode {

0 commit comments

Comments
 (0)