fix(angular): ensure generated editor tsconfig in apps only include runtime files #21945
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.
Current Behavior
Having an application with Jest and Cypress Component Tests setup can result in type conflicts surfaced by the IDE. There's no actual runtime issue.
This happens due to a couple of reasons:
tsconfig.editor.json
includessrc/**/*.ts
, which would include runtime code, Jest spec test files, and Cypres CT test filestsconfig.editor.json
project reference in the projecttsconfig.json
is added after the other (more specific) tsconfig files, and therefore, it takes precedence over themExpected Behavior
Having an application with Jest and Cypress Component Tests setup should show now type conflicts in the IDE.
The
tsconfig.editor.json
file's purpose is to be a sort of catch-all tsconfig file to include new runtime files added to the application source code. This is needed because Angular application normally don't include all runtime code. They instead have the entry point file (e.g.main.ts
) in thefiles
option of thetsconfig.app.json
. That leaves out of the IDE program any new file that's not yet imported by other files part of the program. It's only meant to be used by the IDE, no task actually uses it.Related Issue(s)
Fixes #19132