From 01eeabc18620725d4746b1724c436597fd35d074 Mon Sep 17 00:00:00 2001 From: tommy-mitchell Date: Mon, 4 Mar 2024 12:09:09 -0600 Subject: [PATCH] fix(?) required function fixture --- test/fixtures/required/fixture-required-function.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/test/fixtures/required/fixture-required-function.ts b/test/fixtures/required/fixture-required-function.ts index ec89d24..0fe0e51 100755 --- a/test/fixtures/required/fixture-required-function.ts +++ b/test/fixtures/required/fixture-required-function.ts @@ -16,8 +16,7 @@ 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', @@ -25,12 +24,9 @@ const cli = meow({ }, 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}`);