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(js): do not add typecheck target if tsc is used for build #30211

Merged
merged 7 commits into from
Feb 28, 2025

Conversation

jaysoo
Copy link
Member

@jaysoo jaysoo commented Feb 27, 2025

This PR adds support for skipping typecheck targets when using @nx/js/typescript. Inside tsconfig.json for each project, you can set nx.addTypecheckTarget to false to not infer typecheck.

This allows use to skip typecheck for JS projects using tsc to build. Since tsc is already used during build, we don't need to run typecheck that is just duplicated work.

Current Behavior

JS libs using tsc to build will do typechecking twice. Once during build and once during typecheck.

Expected Behavior

JS libs using tsc do not infer typecheck by default. And users can change this behavior by setting nx.addTypecheckTarget in tsconfig.json.

Related Issue(s)

Fixes #

@jaysoo jaysoo requested a review from a team as a code owner February 27, 2025 18:55
@jaysoo jaysoo requested a review from ndcunningham February 27, 2025 18:55
Copy link

vercel bot commented Feb 27, 2025

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

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Visit Preview Feb 28, 2025 8:50pm

Copy link

nx-cloud bot commented Feb 27, 2025

View your CI Pipeline Execution ↗ for commit 6c8012b.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 10m 1s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 21s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check --base= --he... ✅ Succeeded 7s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 5s View ↗
nx documentation ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2025-02-28 21:02:19 UTC

@jaysoo jaysoo force-pushed the fix/js-skip-typecheck-for-tsc branch from e1aba2e to 865c472 Compare February 27, 2025 21:02
@jaysoo jaysoo requested review from a team as code owners February 27, 2025 21:02
@jaysoo jaysoo requested a review from FrozenPandaz February 27, 2025 21:02
@jaysoo jaysoo force-pushed the fix/js-skip-typecheck-for-tsc branch from 865c472 to fd6086c Compare February 28, 2025 15:40
@jaysoo jaysoo requested a review from a team as a code owner February 28, 2025 15:56
@jaysoo jaysoo merged commit b992e25 into master Feb 28, 2025
12 checks passed
@jaysoo jaysoo deleted the fix/js-skip-typecheck-for-tsc branch February 28, 2025 21:08
Copy link

github-actions bot commented Mar 6, 2025

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 Mar 6, 2025
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.

4 participants