Skip to content

fix(js): do not add typecheck target if tsc is used for build#30211

Merged
jaysoo merged 7 commits intomasterfrom
fix/js-skip-typecheck-for-tsc
Feb 28, 2025
Merged

fix(js): do not add typecheck target if tsc is used for build#30211
jaysoo merged 7 commits intomasterfrom
fix/js-skip-typecheck-for-tsc

Conversation

@jaysoo
Copy link
Copy Markdown
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
@vercel
Copy link
Copy Markdown

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

@nx-cloud
Copy link
Copy Markdown
Contributor

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
Comment thread e2e/vite/src/vite-ts-solution.test.ts
Comment thread e2e/js/src/js-ts-solution.test.ts
@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
Comment thread docs/shared/packages/js/js-plugin.md Outdated
Comment thread docs/shared/packages/js/js-plugin.md Outdated
@jaysoo jaysoo merged commit b992e25 into master Feb 28, 2025
@jaysoo jaysoo deleted the fix/js-skip-typecheck-for-tsc branch February 28, 2025 21:08
@github-actions
Copy link
Copy Markdown
Contributor

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