Skip to content

Commit 62295ff

Browse files
committed
Making the linter happy
1 parent 4314339 commit 62295ff

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
@@ -381,19 +381,11 @@ export function tsEnumMember(value: string | number, metadata: { name?: string;
381381
}
382382

383383
const trimmedDescription = metadata.description?.trim();
384-
if (trimmedDescription === undefined
385-
|| trimmedDescription === null
386-
|| trimmedDescription === ""
387-
) {
384+
if (trimmedDescription === undefined || trimmedDescription === null || trimmedDescription === "") {
388385
return member;
389386
}
390387

391-
return ts.addSyntheticLeadingComment(
392-
member,
393-
ts.SyntaxKind.SingleLineCommentTrivia,
394-
` ${trimmedDescription}`,
395-
true,
396-
);
388+
return ts.addSyntheticLeadingComment(member, ts.SyntaxKind.SingleLineCommentTrivia, ` ${trimmedDescription}`, true);
397389
}
398390

399391
/** 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
@@ -188,7 +188,11 @@ describe("tsEnum", () => {
188188
tsEnum(
189189
".Error.code.",
190190
[100, 101, 102],
191-
[{ name: "Unauthorized", description: "User is unauthorized" }, { name: "NotFound", description: "" }, { name: "Value102", description: null }],
191+
[
192+
{ name: "Unauthorized", description: "User is unauthorized" },
193+
{ name: "NotFound", description: "" },
194+
{ name: "Value102", description: null },
195+
],
192196
),
193197
).trim(),
194198
).toBe(`enum ErrorCode {

0 commit comments

Comments
 (0)