Open KyleJune opened 2 years ago
Here is the temporary workaround I decided on using for now. Using deno check with an empty import map instead of the one in vendor/import_map.json when I want to type check my code. The downside to this is that my test files are unchecked.
deno check --import-map=import_map.json main.ts
Another workaround I thought of was running my tests twice. First with --no-check=remote
and the empty import map, then with the vendor import map and type checking disabled. That would allow me to verify types in my local code and that my code runs with my vendored dependencies. The downside to this would be that my ci would fail if my external deps broke, which kind of defeats one of my motivations for using vendored dependencies. I was having code break due to breaking changes on esm.sh when I wasn't using vendoring.
I'd like a way to disable checks for certain directories. I'm using EdgeDB and it autogenerates code based on your schema. These are the errors I get:
error: TS2590 [ERROR]: Expression produces a union type that is too complex to represent.
> = $.$expr_Function<
^
at file:///~/project/dbschema/edgeql-js/modules/std.ts:1698:5
TS2590 [ERROR]: Expression produces a union type that is too complex to represent.
> = $.$expr_Function<
^
at file:///~/project/dbschema/edgeql-js/modules/std.ts:1753:5
I should be able to ignore dbschema/
within deno.json
, the same way I can disable that same directory for linting.
I have third party dependencies that work with the default
--no-check=remote
option. However once I vendor them and updatingdeno.json
to use thevendor/import_map.json
, I start getting errors type errors. It appears the only workaround for having my dependencies vendored is to rundeno run
anddeno test
with the--no-check
flag to disable all checking. I'd like to have checking for my other local files when I rundeno test
. According to the most recent release blog post, it looks like it's planned to keep local type checking fordeno test
and to remove it fordeno run
.In our
deno.json
file we can configuredeno lint
anddeno fmt
to exclude files and directories. It would be nice if we could do the same with deno's type checking so that we can disable it for the vendor directory generated bydeno vendor
. That would allow me to usedeno vendor
without giving up type checking when I run my tests.Below is an example of one of the type errors I get related to my vendored dependencies. I don't get the type error when not using vendored dependencies.