Closed cscheid closed 5 days ago
I cannot reproduce this error. Type checking works just fine for me. cliffy is supporting the latest stable version of deno. The latest version of cliffy is 1.0.0-rc.5 and is published on jsr. The documentation for this version is not yet published.
Hm. I see the same issue on 1.46.3 and rc.5:
$ deno
Deno 1.46.3
exit using ctrl+d, ctrl+c, or close()
REPL is running with all permissions allowed.
To specify permissions, run `deno repl` with allow flags.
>
$ cat main2.ts
import { Checkbox } from "jsr:@cliffy/prompt@1.0.0-rc.5";
$ deno vendor main2.ts
⚠️ Warning: `deno vendor` is deprecated and will be removed in Deno 2.0.
Add `"vendor": true` to your `deno.json` or use the `--vendor` flag instead.
Vendored 111 modules into vendor/ directory.
To use vendored modules, specify the `--import-map vendor/import_map.json` flag when invoking Deno subcommands or add an `"importMap": "<path_to_vendored_import_map>"` entry to a deno.json file.
$ deno check --all main2.ts --import-map=vendor/import_map.json
Check file:///Users/cscheid/Desktop/daily-log/2024/09/24/cliffy/main2.ts
error: TS2345 [ERROR]: Argument of type '(a: MatchedOption<TValue, TOption, TGroup>, b: MatchedOption<TValue, TOption, TGroup>) => number' is not assignable to parameter of type '(a: MatchedOption<unknown, GenericListOptionSettings<unknown>, GenericListOptionGroupSettings<unknown, GenericListOptionSettings<unknown>>>, b: MatchedOption<...>) => number'.
Types of parameters 'a' and 'a' are incompatible.
Type 'MatchedOption<unknown, GenericListOptionSettings<unknown>, GenericListOptionGroupSettings<unknown, GenericListOptionSettings<unknown>>>' is not assignable to type 'MatchedOption<TValue, TOption, TGroup>'.
Type 'GenericListOptionSettings<unknown>' is not assignable to type 'TOption'.
'TOption' could be instantiated with an arbitrary type which could be unrelated to 'GenericListOptionSettings<unknown>'.
.sort(sortByDistance);
~~~~~~~~~~~~~~
at file:///Users/cscheid/Desktop/daily-log/2024/09/24/cliffy/vendor/jsr.io/@cliffy/prompt/1.0.0-rc.5/_generic_list.ts:796:15
TS2322 [ERROR]: Type 'MatchedOption<unknown, GenericListOptionSettings<unknown>, GenericListOptionGroupSettings<unknown, GenericListOptionSettings<unknown>>>[]' is not assignable to type 'MatchedOption<TValue, TOption, TGroup>[]'.
Type 'MatchedOption<unknown, GenericListOptionSettings<unknown>, GenericListOptionGroupSettings<unknown, GenericListOptionSettings<unknown>>>' is not assignable to type 'MatchedOption<TValue, TOption, TGroup>'.
children,
~~~~~~~~
at file:///Users/cscheid/Desktop/daily-log/2024/09/24/cliffy/vendor/jsr.io/@cliffy/prompt/1.0.0-rc.5/_generic_list.ts:802:11
The expected type comes from property 'children' which is declared here on type 'MatchedOption<TValue, TOption, TGroup>'
children: Array<MatchedOption<TValue, TOption, TGroup>>;
~~~~~~~~
at file:///Users/cscheid/Desktop/daily-log/2024/09/24/cliffy/vendor/jsr.io/@cliffy/prompt/1.0.0-rc.5/_generic_list.ts:157:3
Found 2 errors.
Ok strange, when i use deno vendor
i can reproduce the issue with rc.5 but without deno vendor
remote type-checking works fine for me with deno check --all
.
But i also noticed this issue is already fixed but not yet released. i will do a new release later.
I can't get Cliffy's latest version to type check on deno 1.46.3:
More generally: what's the latest supported version of Cliffy and on what Deno version should I expect Cliffy to work?
We can't skip typechecking in our specific use case because we use the output of
deno vendor
. That makes all imports local, and then Cliffy causes Deno to refuse to run any code because of type-checking failures.