build(turbo): gate type-aware lint on package builds#119
Merged
Conversation
The root `//#lint` task runs oxlint with type-aware checking, which reads each package's compiled `dist/`. It declared no build dependency, so under parallel execution (e.g. `turbo check --force`) it could lint against a half-cleaned `dist/` and report spurious TS2307/TS2305 "cannot find module" errors. The normal CI path (`turbo build && turbo check`) masked this via the `&&` barrier. Anchor lint on `agentcommercekit#build` — the umbrella package transitively depends on every published package, so its `^build` forces the full graph to build before lint starts, regardless of invocation order. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Walkthrough
ChangesTurbo task dependency update
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
dependsOn: ["agentcommercekit#build"]to the root//#lintturbo task.Why
The root
//#linttask runs oxlint with type-aware checking (options.typeAware+oxlint-tsgolint), which reads each package's compileddist/to resolve@agentcommercekit/*declarations. It declared no build dependency.Under sequential invocation the normal CI command (
turbo build && turbo check) is safe — the&&is a barrier, sodist/is fully present before lint runs. But under parallel/forced execution (turbo check --force), the build tasks pulled in viatest → ^buildre-clean and rebuilddist/concurrently with lint, so lint can read a half-builtdist/and emit spurious errors:These look like real source regressions but are pure ordering artifacts.
Fix
The umbrella
agentcommercekitpackage transitively depends on every published package, so anchoring lint onagentcommercekit#buildforces the full build graph (via its own^build) to complete before lint starts — regardless of invocation order. Root^buildcan't be used here because the workspace-root package.json has no dependencies, so it fans out to nothing.Verification
turbo check --force— before: 87 type errors / fails; after: 29/29 tasks pass, 0 errorspnpm run check(normal path) — 29/29 pass, lint 0 warnings/0 errorsoxfmt --check— cleanAI usage disclosure
Per AI_POLICY.md: authored with Claude Code (Opus 4.8). Claude diagnosed the stale-
dist/race, identified the umbrella-anchor fix, and verified it; changes were reviewed by the author.🤖 Generated with Claude Code
Summary by CodeRabbit