Components: Invert tsconfig to be exclude-based #43534
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to #35744
What?
Changes the tsconfig for the components package so that it is an exclude list rather than an include list.
Why?
Currently the TypeScript data for the components package is not available outside the package itself, because we do not generate an
index.d.ts
in thebuild-types
folder. To do this, we need to get to a point wheresrc/index.js
can be included in ourtsconfig.json
. This is a good milestone to hit in the process of working on #35744.We don't necessarily need to manually convert all the remaining components in #35744 before we can hit this milestone, because as long as everything in the code path of
src/index.js
is free of TS errors, it will build. They can still be.js
files, or they can be@ts-nocheck
ed.With this in mind, I think this is a good time to flip the tsconfig so it is an exclude list instead of an include list.
Benefits
src/index.js
milestone.How?
Starting with a universal include, I ran
npx tsc --build --watch
and added excludes for paths that were erroring. Then, I made sure that all paths in the formerinclude
list were still included.Testing Instructions
✅ The types still build