Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore (types): yargs check #151

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

chore (types): yargs check #151

wants to merge 3 commits into from

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.

1 participant