chore: add ESLint no-restricted-imports rule for lazyCaptureException (#914)#922
Merged
sw-factory-automations merged 1 commit intoMay 7, 2026
Conversation
…#914) - Add no-restricted-imports rule to eslint.config.mjs blocking direct imports of lazyCaptureException from @/lib/capture - Exempt src/lib/sentry.ts, src/lib/capture.ts, src/app/global-error.tsx, and src/components/route-error.tsx (classification wrappers and error boundaries) - Migrate 5 remaining production files to import lazyCaptureException from @/lib/sentry instead of @/lib/capture - Update 3 test mocks to match new import paths Co-authored-by: Ona <no-reply@ona.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
Author
|
✅ Post-merge verification skipped — |
Collaborator
Author
|
✅ UI verification passed — no visual changes detected. All |
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.
Closes #914
What
Adds an ESLint
no-restricted-importsrule that prevents direct imports oflazyCaptureExceptionfrom@/lib/capture. This forces developers to use the classified wrappers (captureSupabaseError,captureApiError) from@/lib/sentry, preventing transient Supabase errors from being reported aterrorlevel in Sentry.How
no-restricted-importsrule ineslint.config.mjsscoped tosrc/**/*.tsandsrc/**/*.tsxsrc/lib/sentry.ts,src/lib/capture.ts,src/app/global-error.tsx,src/components/route-error.tsxlazyCaptureExceptionfrom@/lib/captureto import from@/lib/sentryinstead (these were missed by fix: replace raw lazyCaptureException with captureSupabaseError in 10 component files #913)@/lib/sentryinstead of@/lib/captureforlazyCaptureExceptionTesting
pnpm lint— 0 errors (rule active, no violations)pnpm typecheck— passespnpm test— 130 files, 1766 tests passed