Skip to content
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

fix(angular): ensure generated editor tsconfig in apps only include runtime files #21945

Merged
merged 1 commit into from Feb 22, 2024

Conversation

leosvelperez
Copy link
Member

@leosvelperez leosvelperez commented Feb 22, 2024

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:

  • the tsconfig.editor.json includes src/**/*.ts, which would include runtime code, Jest spec test files, and Cypres CT test files
  • the tsconfig.editor.json project reference in the project tsconfig.json is added after the other (more specific) tsconfig files, and therefore, it takes precedence over them

Expected 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 the files option of the tsconfig.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

@leosvelperez leosvelperez self-assigned this Feb 22, 2024
Copy link

vercel bot commented Feb 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Feb 22, 2024 2:03pm

@leosvelperez leosvelperez marked this pull request as ready for review February 22, 2024 14:36
@leosvelperez leosvelperez requested review from a team as code owners February 22, 2024 14:36
@leosvelperez leosvelperez merged commit a1d8645 into nrwl:master Feb 22, 2024
6 checks passed
@leosvelperez leosvelperez deleted the angular/fix-tsconfig-editor branch February 22, 2024 15:32
jaysoo pushed a commit that referenced this pull request Feb 23, 2024
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VS Code shows types conflict between Jest and Cypress when using a library that depends on Cypress
2 participants