Skip to content

Commit

Permalink
Lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
anttiviljami committed Sep 10, 2024
1 parent ce1beca commit a84d6d6
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/typegen/src/typegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,10 @@ export async function main() {

opts.disableOptionalPathParameters = argv.disableOptionalPathParameters ?? true;

const [imports, schemaTypes, operationTypings, banner, aliases] = await generateTypesForDocument(argv._[0] as string, opts);
const [imports, schemaTypes, operationTypings, banner, aliases] = await generateTypesForDocument(
argv._[0] as string,
opts,
);

if (opts.banner && banner?.length) {
console.log(banner, '\n');
Expand Down Expand Up @@ -114,7 +117,7 @@ export async function generateTypesForDocument(definition: Document | string, op
const api = new OpenAPIClientAxios({ definition: normalizedSchema as Document });

await api.init();

const operationTypings = generateOperationMethodTypings(api, exportedTypes, opts);
const rootLevelAliases = generateRootLevelAliases(exportedTypes);

Expand Down Expand Up @@ -252,9 +255,7 @@ const generateRootLevelAliases = (exportedTypes: ExportedType[]) => {
for (const exportedType of exportedTypes) {
if (exportedType.schemaRef.startsWith('#/components/schemas/')) {
const name = exportedType.schemaRef.replace('#/components/schemas/', '');
aliases.push([
`export type ${name} = ${exportedType.path};`,
].join('\n'));
aliases.push([`export type ${name} = ${exportedType.path};`].join('\n'));
}
}

Expand Down

0 comments on commit a84d6d6

Please sign in to comment.