<p dir="auto">Now <code class="notranslate">deno check</code> command provides two options in terms of how many modules it's going to typecheck.</p>
<ul dir="auto">
<li>no option: only local modules are typechecked</li>
<li><code class="notranslate">--all</code>: all modules including remote are typechecked</li>
</ul>
<p dir="auto">This suffices in almost all use cases, but it's going to be complicated if we want to perform typecheck within the project that vendors external dependencies using <code class="notranslate">deno vendor</code>. Vendored dependencies are considered "local" so <code class="notranslate">deno check</code> will check for vendored ones as well. This is sometimes troublesome if vendored dependencies have type errors that are known and acceptable.</p>
<p dir="auto">So it would be great if we could have a new option, let's say <code class="notranslate">--ignore=&lt;ignore&gt;</code>, that make the type checker ignore type errors happening in the specified files. This way, specifying <code class="notranslate">--ignore=vendor/</code> will allow us to ignore vendored dependencies.</p>
<p dir="auto">I have third party dependencies that work with the default <code class="notranslate">--no-check=remote</code> option. However once I vendor them and updating <code class="notranslate">deno.json</code> to use the <code class="notranslate">vendor/import_map.json</code>, I start getting errors type errors. It appears the only workaround for having my dependencies vendored is to run <code class="notranslate">deno run</code> and <code class="notranslate">deno test</code> with the <code class="notranslate">--no-check</code> flag to disable all checking. I'd like to have checking for my other local files when I run <code class="notranslate">deno test</code>. According to the most recent release <a href="https://deno.com/blog/v1.22#default-type-checking-behavior-has-been-updated" rel="nofollow">blog post</a>, it looks like it's planned to keep local type checking for <code class="notranslate">deno test</code> and to remove it for <code class="notranslate">deno run</code>.</p>
<p dir="auto">In our <code class="notranslate">deno.json</code> file we can configure <code class="notranslate">deno lint</code> and <code class="notranslate">deno fmt</code> 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 by <code class="notranslate">deno vendor</code>. That would allow me to use <code class="notranslate">deno vendor</code> without giving up type checking when I run my tests.</p>
<p dir="auto">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.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="error: TS2339 [ERROR]: Property 'spawn' does not exist on type 'typeof Deno'. 'Deno.spawn' is an unstable API. Did you forget to run with the '--unstable' flag?
  const { status, stderr } = await Deno.spawn(Deno.execPath(), {
                                        ~~~~~
    at file:///home/kyle/Projects/deno/udibo/vendor/deno.land/std@0.141.0/node/_utils.ts:228:41"><pre class="notranslate"><code class="notranslate">error: TS2339 [ERROR]: Property 'spawn' does not exist on type 'typeof Deno'. 'Deno.spawn' is an unstable API. Did you forget to run with the '--unstable' flag?
  const { status, stderr } = await Deno.spawn(Deno.execPath(), {
                                        ~~~~~
    at file:///home/kyle/Projects/deno/udibo/vendor/deno.land/std@0.141.0/node/_utils.ts:228:41
</code></pre></div>