Skip to content

build(turbo): gate type-aware lint on package builds#119

Merged
venables merged 1 commit into
mainfrom
chore/harden-lint-build-ordering
Jun 25, 2026
Merged

build(turbo): gate type-aware lint on package builds#119
venables merged 1 commit into
mainfrom
chore/harden-lint-build-ordering

Conversation

@venables

@venables venables commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

What

Adds dependsOn: ["agentcommercekit#build"] to the root //#lint turbo task.

Why

The root //#lint task runs oxlint with type-aware checking (options.typeAware + oxlint-tsgolint), which reads each package's compiled dist/ 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, so dist/ is fully present before lint runs. But under parallel/forced execution (turbo check --force), the build tasks pulled in via test → ^build re-clean and rebuild dist/ concurrently with lint, so lint can read a half-built dist/ and emit spurious errors:

TS2307: Cannot find module '@agentcommercekit/keys'
TS2305: Module 'agentcommercekit' has no exported member 'generateKeypair'

These look like real source regressions but are pure ordering artifacts.

Fix

The umbrella agentcommercekit package transitively depends on every published package, so anchoring lint on agentcommercekit#build forces the full build graph (via its own ^build) to complete before lint starts — regardless of invocation order. Root ^build can'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 errors
  • pnpm run check (normal path) — 29/29 pass, lint 0 warnings/0 errors
  • oxfmt --check — clean

AI 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

  • Chores
    • Updated the project workflow so linting now runs after a required build step, helping keep checks more reliable.

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>
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4f4b5583-3962-4bf7-9268-d94b591762f3

📥 Commits

Reviewing files that changed from the base of the PR and between 772f026 and 30bc515.

📒 Files selected for processing (1)
  • turbo.json

Walkthrough

turbo.json updates the lint task to depend on agentcommercekit#build while keeping lint cache disabled.

Changes

Turbo task dependency update

Layer / File(s) Summary
Lint depends on build
turbo.json
tasks.lint adds dependsOn: ["agentcommercekit#build"] alongside cache: false.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the Turbo lint dependency change and its purpose.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/harden-lint-build-ordering

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@venables venables merged commit 30bc515 into main Jun 25, 2026
1 of 2 checks passed
@venables venables deleted the chore/harden-lint-build-ordering branch June 25, 2026 19:48
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.

1 participant