@@ -82,8 +82,8 @@ export async function executeCodegen(input: CodegenContext | Types.Config): Prom
8282 const cache = createCache ( ) ;
8383
8484 function wrapTask ( task : ( ) => void | Promise < void > , source : string , taskName : string , ctx : Ctx ) {
85- return ( ) => {
86- return context . profiler . run ( async ( ) => {
85+ return ( ) =>
86+ context . profiler . run ( async ( ) => {
8787 try {
8888 await Promise . resolve ( ) . then ( ( ) => task ( ) ) ;
8989 } catch ( error ) {
@@ -95,7 +95,6 @@ export async function executeCodegen(input: CodegenContext | Types.Config): Prom
9595 throw error ;
9696 }
9797 } , taskName ) ;
98- } ;
9998 }
10099
101100 async function normalize ( ) {
@@ -203,7 +202,7 @@ export async function executeCodegen(input: CodegenContext | Types.Config): Prom
203202
204203 return {
205204 title,
206- task : async ( _ , subTask ) => {
205+ async task ( _ , subTask ) {
207206 let outputSchemaAst : GraphQLSchema ;
208207 let outputSchema : DocumentNode ;
209208 const outputFileTemplateConfig = outputConfig . config || { } ;
@@ -217,7 +216,7 @@ export async function executeCodegen(input: CodegenContext | Types.Config): Prom
217216 : outputConfig . preset
218217 : null ;
219218
220- if ( preset && preset . prepareDocuments ) {
219+ if ( preset ? .prepareDocuments ) {
221220 outputSpecificDocuments = await preset . prepareDocuments ( filename , outputSpecificDocuments ) ;
222221 }
223222
@@ -314,7 +313,7 @@ export async function executeCodegen(input: CodegenContext | Types.Config): Prom
314313 ...( typeof outputFileTemplateConfig === 'string'
315314 ? { value : outputFileTemplateConfig }
316315 : outputFileTemplateConfig ) ,
317- emitLegacyCommonJSImports : shouldEmitLegacyCommonJSImports ( config , filename ) ,
316+ emitLegacyCommonJSImports : shouldEmitLegacyCommonJSImports ( config ) ,
318317 } ;
319318
320319 const outputs : Types . GenerateOptions [ ] = preset
@@ -400,7 +399,6 @@ export async function executeCodegen(input: CodegenContext | Types.Config): Prom
400399 // All the errors throw in `listr2` are collected in context
401400 // Running tasks doesn't throw anything
402401 const executedContext = await tasks . run ( ) ;
403-
404402 if ( config . debug ) {
405403 // if we have debug logs, make sure to print them before throwing the errors
406404 printLogs ( ) ;
0 commit comments