Repository navigation
chore(mosaic): enable stricter type-safety and hooks lint rules - #10122
Conversation
🦋 Changeset detectedLatest commit: b8965bd 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 configuration
📒 Files selected for processing (2)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
Limit details: You’ve used all 4 included reviews currently available. Your 68 included PR review attempts over the past 7 days set your current allowance at 4 reviews per hour. 📝 WalkthroughWalkthroughThe PR enables additional ESLint rules for Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Merge Risk: ⚪ Minimal · up to The inspected error, observer, and layout paths retain their existing behavior. No concrete user-facing regression remains to resolve before merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
0249c3c to
f0f3f20
Compare
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/electron
@clerk/electron-passkeys
@clerk/eslint-plugin
@clerk/expo
@clerk/expo-biometrics
@clerk/expo-google-signin
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/hono
@clerk/localizations
@clerk/mosaic
@clerk/nextjs
@clerk/nuxt
@clerk/react
@clerk/react-router
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/ui
@clerk/upgrade
@clerk/vue
commit: |
f0f3f20 to
fb522a5
Compare
e2d2828 to
4cf54bf
Compare
4cf54bf to
b8965bd
Compare
Description
Turns on the stricter rules Fredrik flagged as errors in the
packages/mosaiclint block:no-explicit-any, the fiveno-unsafe-*rules,ban-ts-comment,no-floating-promises,no-misused-promises,await-thenable,only-throw-error,prefer-promise-reject-errors,use-unknown-in-catch-callback-variable,react-hooks/rules-of-hooksandreact-hooks/exhaustive-deps.Hits are fixed at the source. No new bulk suppressions; the
create-actor.tsassertion count drops from 9 to 8.utils/errors.ts, password errors: read API errors through the typedClerkAPIErrorinterface instead of the class, whosemetadefaults toany. The picture and organization logo controllers use a newtoGlobalError.css-vars.ts: narrow floating-ui's untypedalignSelectedItemmiddleware data fromunknown.use-reverification-with-state.ts: the fetcher type is derived fromuseReverification's parameter instead of restating itsanyconstraint.use-in-view.ts: observer options are read from the latest-params ref, likeonChangealready was, so the ref callback stays stable.create-actor.ts,jest-dom.d.ts:anyreplaced withunknown.Five disables remain, each with a reason:
user-button.tsx(x2):appearancefrom@clerk/sharedis an unresolved type until a framework augmentsClerkAppearanceRegistry. It is passed through untouched.use-mosaic-environment.ts:__internal_environmentis implemented by clerk-js but not declared on the sharedClerktype. The existing@ts-expect-errorstays, andno-unsafe-returnis disabled on the same line because that access is untyped.machine/types.ts:invokeneeds a per-state output type. Withunknown, typedonDonehandlers fail to compile (checked with tsc).use-render.tsx: therefon render props. This was already an intentionalanywith a SAFETY comment; the reason moved into the directive.Behavior changes
useInViewreadsroot,rootMarginandthresholdwhen the observed element attaches, instead of from the first render. The only caller (use-organization-list-in-view.ts) passes a constantthreshold: 0, so it behaves the same.react/jsx-no-leaked-renderis left out. It is not type-aware, and all 10 sites it flagged were false positives, mostly&&inside props rather than children.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change