Skip to content

Commit

Permalink
fix(?) required function fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy-mitchell committed Mar 4, 2024
1 parent 8825f96 commit 01eeabc
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions test/fixtures/required/fixture-required-function.ts
Expand Up @@ -16,21 +16,17 @@ const cli = meow({
withTrigger: {
type: 'string',
// TODO: change type to allow truthy / falsy values?
// @ts-expect-error: falsy trigger is still boolean
isRequired: (flags, _) => flags.trigger,
isRequired: (flags, _) => Boolean(flags.trigger),
},
allowError: {
type: 'boolean',
shortFlag: 'a',
},
shouldError: {
type: 'boolean',
// @ts-expect-error: invalid string return
isRequired: (flags, _) => flags.allowError ? 'should error' : false,
isRequired: (flags, _) => (flags.allowError ? 'should error' : false) as boolean,
},
},
});

// TODO: errors above make flags untyped
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
console.log(`${cli.flags.trigger},${cli.flags.withTrigger}`);

0 comments on commit 01eeabc

Please sign in to comment.