-
Notifications
You must be signed in to change notification settings - Fork 71
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
skipLibCheck: false
does not output diagnostics for ambient types
#212
Comments
Nothing the plugin does explicitly... Maybe one of the options it does force implies it? Could you run the build with verbosity 4 and post output, specifically |
Sure, here's Log output
|
I don't see that option in there. Why do you think it is turned on? |
If I have a type error in a declaration file, it doesn't error out and the build succeeds. Perhaps "forced to true" is incorrect wording then, instead it doesn't error even if I can make a repro for this if you need it, just don't have the time right now and figured I'd respond first. |
Repro would be good, but no rush on it, I won't be able to fix it right away anyway (unless it is a very easy and safe fix). PR is even better :) |
Was debugging something else ( |
Plugin's exclude is for avoiding transpiling those files (no js would be generated by transpiling d.ts), also typescript files shouldn't be importing type files, I think they are supposed to be magically found by tsc, but never imported. Also rollup does tree shaking and some files might be never imported. You should see evidence of that in verbose output -- do a build and see if any source files that use affected type file are even transpiled. Also check if cache is potentially hiding it, do a build with Usually typescript will find all ambient type files and rpt2 will list them at the start of the build and invalidate cache if they changed. |
skipLibCheck
is forced to true
skipLibCheck
is forced to trueskipLibCheck: false
does not output diagnostics for ambient types
So now that I know this codebase really well, I'm pretty sure that the problem is that rpt2 doesn't output diagnostics for any ambient types. I've renamed the issue as such. So while the Basically, to properly follow TS behavior, we'd want to emit diagnostics for all ambient typings as well when That would greatly decrease performance, so I might suggest to add a plugin option that disables this by default. That being said,
Definitely low priority if it would be disabled by default; that would just be a That being said, I believe when I originally made this issue I was actually authoring a declaration file and it wasn't checked (or something? would've been great if I made a repro 😅 ). This not being type-checked because of the default |
What happens and why it is wrong
tsconfig.compilerOptions.skipLibCheck
is by defaultfalse
, but will always be forced totrue
when using rpts2.This isn't documented in the README "Some compiler options are forced" so I'm not sure why this is the case or if this is intentional. I couldn't find any code references or issues about this.
Related to jaredpalmer/tsdx#529 (comment)
Environment
[email protected]
Versions
rollup.config.js
TSDX Rollup
tsconfig.json
package.json
plugin output with verbosity 3
The text was updated successfully, but these errors were encountered: