Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compileOptions in deno.json doesn't support skipLibCheck #21855

Open
iuioiua opened this issue Jan 8, 2024 · 3 comments
Open

compileOptions in deno.json doesn't support skipLibCheck #21855

iuioiua opened this issue Jan 8, 2024 · 3 comments
Labels
suggestion suggestions for new features (yet to be agreed)

Comments

@iuioiua
Copy link
Contributor

iuioiua commented Jan 8, 2024

Enabling this setting can be a performance benefit to a codebase when type-checking of .d.ts files isn't required.

See denoland/std#4134
See https://www.typescriptlang.org/tsconfig#skipLibCheck

@dsherret
Copy link
Member

dsherret commented Jan 8, 2024

I don't think there will be much of a performance improvement here because we already do this for remote modules when you don't specify --all (ex. deno check --all). I'm not really sure it's worth adding to Deno actually since we already have the default and --all.

@bartlomieju
Copy link
Member

@dsherret does this option in TSC works in the same way as our --all flag - ie. does it still type check them but doesn't produce diagnostics?

@dsherret dsherret added the suggestion suggestions for new features (yet to be agreed) label Jan 11, 2024
@nnmrts
Copy link
Contributor

nnmrts commented Feb 11, 2024

I think I found a use case for this, however I'm not entirely sure.

I think it's related to these, but I'm also not entirely sure of that:

Quote from microsoft/TypeScript#33111:

FWIW I don’t think --skipLibCheck prevents the types from being pulled in - it just stops the .d.ts files themselves from being type checked. That was my understanding, anyway.


Anyways, my personal case is the following: I imported https://github.com/xstevenyung/fresh-seo into my fresh.config.js in my fresh project. The file https://github.com/xstevenyung/fresh-seo/blob/main/src/sitemap.ts there has this at the top:

/// <reference no-default-lib="true" />
/// <reference lib="dom" />
/// <reference lib="dom.asynciterable" />
/// <reference lib="deno.ns" />
/// <reference lib="deno.unstable" />

Notice how there's no dom.iterable? Yep, this caused my whole codebase (or at least the Deno vscode extension) to suddenly not know about dom.iterable anymore, not just this file, even though I explicitly added dom.iterable to my deno.json compilerOptions.lib array. Maybe I'm doing something wrong here as well but it took me hours to find out why my FormData or URLSearchParams suddenly have no entries() anymore...

Again, I'm not really sure if skipLibCheck would fix that and at this point I'm too afraid to ask because there are seemingly half a dozen different ways to include libraries in TypeScript (triple slash stuff, .d.ts files, normal .ts files, tsconfig.json, jsconfig.json, deno.json, ...). But it would be nice to have an on-and-off-switch for this "intended" behavior of dependencies screwing up my local typechecking, and if skipLibCheck could be that switch, I'd very much appreciate it being added to the deno.json compilerOptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion suggestions for new features (yet to be agreed)
Projects
None yet
Development

No branches or pull requests

4 participants