Skip to content

Conversation

@cajubelt
Copy link
Contributor

@cajubelt cajubelt commented May 10, 2023

my IDE was showing this error for the check callback as it was previously written:

Argument type ({quoteInMock, quoteOutMock}: {quoteInMock: any, quoteOutMock: any}) => true is not assignable to parameter type (argv: Arguments<{} & {[key in "test-private-key"]: InferredOptionType<{default: string, description: string, type: "string"}>} & Alias<{default: string, description: string, type: "string"}> & {[key in "base-url"]: InferredOptionType<{demandOption: boolean, description: string, type: "string"}>} & Alias<{demandOption: boolean, description: string, type: "string"}> & {[key in "path-prefix"]: InferredOptionType<{default: string, description: string, type: "string", example: string}>} & Alias<{default: string, description: string, type: "string", example: string}> & {[key in "openapi-spec"]: InferredOptionType<{coerce: (arg: any) => string, demandOption: boolean, description: string, type: "string"}>} & Alias<{coerce: (arg: any) => string, demandOption: boolean, description: string, type: "string"}> & {[key in "client-api-key"]: InferredOptionType<{demandOption: boolean, description: string, type: "string"}>} & Alias<{demandOption: boolean, description: string, type: "string"}> & ...>, aliases: {[p: string]: string}) => any 

It looks like the IDE doesn't understand that args adds camelCase versions of all the kebab-case arguments to argv.

Strangely, no build errors result, and this also does not cause any runtime errors when running tests. I'm pushing this update anyway in case it improves devX for others too.

@cajubelt cajubelt changed the title chore (types): dont destructure argv in yargs check chore (types): yargs check May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants