import { group, select } from '@clack/prompts';
(async function create() {
const { language } = await group({
language: () =>
select({
message: 'Project langauge:',
// uncomment following line and the error disappears
//initialValue: 'js',
options: [
{ value: 'js', label: 'JavaScript' } // Type 'string' is not assignable to type 'void'. (tsserver 2322)
],
}),
});
})();
Steps to reproduce the behavior:
Follow link
Observe error
Uncomment the initialValue line
Observe error disappearing
Expected behavior
Shouldn't be a type error, AFAIK initialValue does not need to be present, as Clack works perfectly fine without.
Environment
@clack/prompts
Describe the bug Just a TS error, nothing is functionally wrong.
When using
select
withingroup
, andinitialValue
is not provided, the type forvalue
in the options is mistakenlyvoid
.To Reproduce Minimal Repro
Steps to reproduce the behavior:
initialValue
lineExpected behavior Shouldn't be a type error, AFAIK
initialValue
does not need to be present, as Clack works perfectly fine without.