-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Compile libraries with --strict=false, but compile src with --strict #33177
Comments
No, you are right, all files in a compilation have to use the same settings. There is no way for a library to compile in non-strict, but have source compile in strict. |
Ok thanks. Then this would be a feature request - it would be nice to compile libraries in strict and source in non-strict, or vice versa. Even compiling certain libraries as strict and certain ones as non-strict, perhaps according to their tsconfig.json files (if those are not excluded by .npmignore etc). |
I thought we had seen this request before but I can't find it. This is a surprisingly complex feature, so we need some kind of proposal that thinks through the issues. |
Yep, that's it. Thanks @MartinJohns |
Search Terms
strict mode, strict, skipLibCheck
Suggestion
Allow uses to use:
what it means is users want to re-compile library code (for some reason?), but want to switch strict mode off for library code.
Use Cases
I maintain a few libraries written in TS and sometimes users will say my library doesn't compile in strict mode. I prefer to not use strict mode. So I can tell my users to use
compilerOptions.skipLibCheck = true
, but sometimes they don't want to skipLibCheck, so it would be nice for them to skip strict checking for libraries, but do strict checking for their own code?important: I may have a misunderstanding - it could be that
tsconfig.json
in node_modules projects override the end-user's settings, so perhaps I can prevent strict mode for library, in the case that my library only compiles in non-strict mode?Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: