Skip to content

Fix nx configuration to actually run type linter#32776

Merged
richvdh merged 3 commits intodevelopfrom
rav/no-tsc-via-pnpm
Mar 13, 2026
Merged

Fix nx configuration to actually run type linter#32776
richvdh merged 3 commits intodevelopfrom
rav/no-tsc-via-pnpm

Conversation

@richvdh
Copy link
Copy Markdown
Member

@richvdh richvdh commented Mar 12, 2026

The current configuration for nx lint:types indirects its tsc incantations via pnpm, but that means they don't actually work due to a pnpm reentrancy bug (pnpm/pnpm#5291) which causes pnpm not to run those commands at all if the top level pnpm has --if-present.

Turns out that adding an explicit exec to the pnpm commandline works around the bug.

Also I've taken the opportunity to document the reason the indirection is there in the first place, to save anyone else losing a day on it. (It seems to be some sort of knip bug, but reproducing it outside element-web was more effort than I can spare.)

Currently, `nx lint:types` is configured to indirect its `tsc` incantations via
pnpm. As far as I can tell, this is unnecessary; worse, it means we seem to hit
a pnpm reentrancy bug which causes pnpm not to run those commands at all if the
top level pnpm has `--if-present`.
@richvdh richvdh requested a review from a team as a code owner March 12, 2026 12:38
@richvdh richvdh requested review from dbkr and florianduros March 12, 2026 12:38
@richvdh richvdh changed the title do not indirect tsc commands via tsc do not indirect tsc commands via pnpm Mar 12, 2026
@dbkr dbkr mentioned this pull request Mar 12, 2026
5 tasks
@richvdh richvdh changed the title do not indirect tsc commands via pnpm Fix nx configuration to actually run type linter Mar 12, 2026
Comment on lines +37 to +39
// We indirect via `pnpm exec` to stop knip interpreting the
// commandline and declaring `playwright` and `./tsconfig.module_system.json`
// as unlisted dependencies.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I suppose nx accepts comments in json

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

thankfully it seems to, yes

@richvdh richvdh added this pull request to the merge queue Mar 13, 2026
Merged via the queue into develop with commit 8fe2e72 Mar 13, 2026
59 checks passed
@richvdh richvdh deleted the rav/no-tsc-via-pnpm branch March 13, 2026 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants