Skip to content

fix(core): avoid tsconfig path false positives for sibling project roots#35796

Open
cw-alexcroteau wants to merge 2 commits into
nrwl:masterfrom
cw-alexcroteau:fix/tsconfig-path-prefix-false-positive-v2
Open

fix(core): avoid tsconfig path false positives for sibling project roots#35796
cw-alexcroteau wants to merge 2 commits into
nrwl:masterfrom
cw-alexcroteau:fix/tsconfig-path-prefix-false-positive-v2

Conversation

@cw-alexcroteau

Copy link
Copy Markdown
Contributor

Current Behavior

Root tsconfig path changes can mark sibling project roots as touched when they only share a string prefix.

Expected Behavior

Only the project whose root contains the changed path, or exactly matches it, should be marked as touched.

Related Issue(s)

Fixes #35795

Summary

Supersedes closed PR #35786.

@cw-alexcroteau cw-alexcroteau requested a review from a team as a code owner May 25, 2026 18:45
@netlify

netlify Bot commented May 25, 2026

Copy link
Copy Markdown

👷 Deploy request for nx-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 9dd4977

@netlify

netlify Bot commented May 25, 2026

Copy link
Copy Markdown

👷 Deploy request for nx-dev pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 9dd4977

@nx-cloud

nx-cloud Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 8e92584

Command Status Duration Result
nx-cloud record -- nx format:check ❌ Failed 5s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 3s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 20s View ↗

☁️ Nx Cloud last updated this comment at 2026-06-12 14:10:26 UTC

@nx-cloud nx-cloud Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nx Cloud is proposing a fix for your failed CI:

We ran nx format to fix the format:check failure caused by the newly added regression test in tsconfig-json-changes.spec.ts. The long path strings inside the paths object exceeded prettier's print width, requiring the array values to be wrapped onto separate lines. This formatting change brings the file into compliance with the workspace's code style rules.

Tip

We verified this fix by re-running nx-cloud record -- nx format:check.

Suggested Fix changes
diff --git a/packages/nx/src/plugins/js/project-graph/affected/tsconfig-json-changes.spec.ts b/packages/nx/src/plugins/js/project-graph/affected/tsconfig-json-changes.spec.ts
index a7f893c8..1f665881 100644
--- a/packages/nx/src/plugins/js/project-graph/affected/tsconfig-json-changes.spec.ts
+++ b/packages/nx/src/plugins/js/project-graph/affected/tsconfig-json-changes.spec.ts
@@ -335,14 +335,18 @@ describe('getTouchedProjectsFromTsConfig', () => {
                     {
                       compilerOptions: {
                         paths: {
-                          '@proj/cdk-utils': ['libs/typescript/cdk-utils/index.ts'],
+                          '@proj/cdk-utils': [
+                            'libs/typescript/cdk-utils/index.ts',
+                          ],
                         },
                       },
                     },
                     {
                       compilerOptions: {
                         paths: {
-                          '@proj/cdk-utils': ['libs/typescript/cdk-utils/utils.ts'],
+                          '@proj/cdk-utils': [
+                            'libs/typescript/cdk-utils/utils.ts',
+                          ],
                         },
                       },
                     }

Because this branch comes from a fork, it is not possible for us to apply fixes directly, but you can apply the changes locally using the available options below.

Apply changes locally with:

npx nx-cloud apply-locally 1lo6-u1jw

Apply fix locally with your editor ↗   View interactive diff ↗



🎓 Learn more about Self-Healing CI on nx.dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(core): avoid tsconfig path false positives for sibling project roots

1 participant