Skip to content

Commit 6de4d26

Browse files
Fix lints and examples
1 parent 03ac2ce commit 6de4d26

9 files changed

+17040
-17037
lines changed

examples/digital-ocean-api.ts

+1,971-1,971
Large diffs are not rendered by default.

examples/github-api-next.ts

+7,439-7,439
Large diffs are not rendered by default.

examples/github-api.ts

+5,909-5,909
Large diffs are not rendered by default.

examples/octokit-ghes-3.6-diff-to-api.ts

+791-791
Large diffs are not rendered by default.

examples/stripe-api.ts

+919-919
Large diffs are not rendered by default.

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ async function openapiTS(
185185
// 3. operations (only get fully built after all external schemas transformed)
186186
if (Object.keys(ctx.operations).length) {
187187
output.push(options.exportType ? "export type operations = {" : "export interface operations {", "");
188-
for (const [ key, { operationType, comment }] of Object.entries(ctx.operations)) {
188+
for (const [key, { operationType, comment }] of Object.entries(ctx.operations)) {
189189
if (comment) output.push(indent(comment, 1));
190190
output.push(indent(`${escObjKey(key)}: ${operationType};`, 1));
191191
}

src/transform/path-item-object.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default function transformPathItemObject(
3030
// if operationId exists, move into an `operations` export and pass the reference in here
3131
else if (operationObject.operationId) {
3232
const operationType = transformOperationObject(operationObject, { path, ctx: { ...ctx, indentLv: 1 } });
33-
ctx.operations[operationObject.operationId] = {
33+
ctx.operations[operationObject.operationId] = {
3434
operationType,
3535
comment: getSchemaObjectComment(operationObject, 1),
3636
};

src/types.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -638,10 +638,13 @@ export interface GlobalContext {
638638
postTransform: OpenAPITSOptions["postTransform"];
639639
immutableTypes: boolean;
640640
indentLv: number;
641-
operations: Record<string, {
642-
comment?: string;
643-
operationType: string;
644-
}>;
641+
operations: Record<
642+
string,
643+
{
644+
comment?: string;
645+
operationType: string;
646+
}
647+
>;
645648
pathParamsAsTypes: boolean;
646649
silent: boolean;
647650
supportArrayLength: boolean;

test/path-item-object.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ describe("Path Item Object", () => {
111111
});
112112

113113
test("operations", () => {
114-
const operations: GlobalContext['operations'] = {};
114+
const operations: GlobalContext["operations"] = {};
115115
const schema: PathItemObject = {
116116
get: {
117117
description: "Get a user",
@@ -156,7 +156,7 @@ describe("Path Item Object", () => {
156156
};
157157
};
158158
}`,
159-
}
159+
},
160160
});
161161
});
162162
});

0 commit comments

Comments
 (0)