-
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
Skip .d.ts checks from referenced projects #43140
Comments
We've gotten the request to "Skip lib check, but don't skip my lib checks" before. Skipping referenced projects and node_modules while still checking local .d.ts files should be done concurrently with #30511. |
Thank you for you quick answer. |
Right. What I'm saying is, if we have any feature like this, it should apply equally to |
I understand. I'll close this and will follow the other ticket. Thanks! |
Suggestion
From what i have seen, it appears that declaration files generated from a project are re-checked when compiling projects referencing it.
Here is an example:
tsconfig-a.json
: includea.ts
tsconfig-b.json
: includeb.ts
when building
tsconfig-b.json
, we can see:a.ts
is type-checkedoutDir/a.d.ts
andb.ts
is type-checked.(I can provide a repository with this example if needed)
This is an issue because when using many projects to split a big codebase, those output files are re-checked again and again,
leading to a huge time loss.
This is evident when using the
skipLibCheck
. In our repository with about 900 typescript files and 15 projects:skipLibCheck
: 3 minutes to runtsc -b
skipLibCheck
: 1 minute 15 seconds to runtsc -b
Unless i'm missing something, this shows clearly that declaration files from referenced projects are type-checked again and again, and it isn't just declaration files from node_modules which are skipped.
The issue with
skipLibCheck
is that it skips declaration files from the repository, and not just from node_modules or projects output directories.Forgive me if i'm wrong, or if this has been talked about already, I have not found anything about this in my searches.
🔍 Search Terms
project references
,skipLibCheck
,declaration files
✅ Viability Checklist
My suggestion meets these guidelines:
⭐ Suggestion
My suggestion is to skip checking declaration files when they come from a referenced project, as we already know it has been type checked.
📃 Motivating Example
This change would:
💻 Use Cases
Use-case is using project references to split a big codebase into chunks and improve build time, without being forced to use
skipLibCheck
.I don't think there is any drawback to the change.
Workaround is using
skipLibCheck
, but it disables type-checking on declaration files that are inside a project.The text was updated successfully, but these errors were encountered: