chore(repo): gate cognitive complexity with bulk suppressions - #9749
alexcarpenter wants to merge 4 commits into
Conversation
🦋 Changeset detectedLatest commit: 007419a The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: ASSERTIVE Plan: Team Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (20)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Included review availability: 3 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 8 reviews per hour. 📝 WalkthroughWalkthroughThe repository now includes
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Merge Risk: ⚪ Minimal · up to The PR enables cognitive-complexity enforcement while preserving existing violations through suppressions, with no identified merge-blocking risk. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
Warning Linked repositories: Your configuration references 7 linked repositories, but your current plan allows 5. Analyzed Comment |
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-google-signin
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
| - Use `pnpm` only. `npm` and `yarn` are blocked by `preinstall`. Node `>=24.15`, pnpm `>=10.33`. | ||
| - Every PR needs a changeset. `pnpm changeset` for package changes, `pnpm changeset:empty` for tooling/repo-only. Empty changesets are two `---` delimiters with no body. A changeset is a changelog entry for users upgrading the package, not a summary of the work done in the PR. Describe the user-facing change (what changed for someone consuming the library and how it affects them) rather than the implementation details of the diff. If a change has no user-facing impact, use an empty changeset. | ||
| - PR descriptions follow `.github/PULL_REQUEST_TEMPLATE.md` and add no sections of their own. Never add a "Testing" (or "Test plan" / "How to test") section summarizing the tests written or the checks run; the Checklist covers that and reviewers read the diff. Describe the change, not the work done on it. | ||
| - Keep functions under a cognitive complexity of 15 (`sonarjs/cognitive-complexity`, reported as an error). Pre-existing violations are grandfathered in each package's `eslint-suppressions.json`. A change that pushes a function past the limit must split it; do not add new suppressions or `eslint-disable` comments for this rule. When a grandfathered function is simplified, run `pnpm eslint src --prune-suppressions` in that package and commit the result. |
There was a problem hiding this comment.
lets try without this rule. I think the agent would likely do the right thing.
API Changes Report
Summary
No API Changes DetectedAll packages have stable APIs with no detected changes. Report generated by Break Check Last ran on |
Description
Adds
sonarjs/cognitive-complexityas an error at 15 so new functions can't land over the limit.Cognitive over ESLint's
complexity: cyclomatic counts every??,?.,&&, and default param as a branch, so a component merging props from context scores like a 60-line state machine. Cognitive scores a fallback chain as one and penalizes nesting instead, so it flags functions that are genuinely hard to follow rather than ones that are just wide.Existing violations (92 functions, 15 packages) are grandfathered via ESLint bulk suppressions in each package's
eslint-suppressions.json. No inline disables, no refactoring required to land this. Fixing one leaves a stale entry that fails lint until pruned, so the baseline only shrinks.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change