Repository navigation
chore(lint): clear final no-unsafe inventory in bot handlers (#1378) - #1385
Conversation
Lands the no-unsafe-* family at 0 globally and promotes all five rules
warn -> error in the bot+shared ratchet block, so they now guard against
regressions instead of accumulating. Typing-only; no behavior change.
- memberHandler: type the welcome/leave embedData (JSON.parse result) as the
shared `EmbedData` and pass `setTitle(... || null)` to match its signature.
- giveaway: type the `require('../../../client')` fallback cast; note that the
path is broken (#1383) so the require throws and the catch returns.
Validation: root lint exit 0 (0 errors, no-unsafe family enforced), bot tsc
clean (local TS 6.0), full bot suite green (2536 passed). Remaining ratchet
warnings: no-non-null-assertion (86, Phase 4) + small core rules.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
Warning Review limit reached
More reviews will be available in 9 minutes and 40 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ 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 |
|
@cubic-dev-ai please review |
@LucasSantana-Dev I have started the AI code review. It will take a few minutes to complete. |
|
Failed to generate code suggestions for PR |
There was a problem hiding this comment.
No issues found across 3 files
Auto-approved: Clears remaining no-unsafe-* warnings with type casts and promotes rules to error; changes are typing-only with no behavioral impact.
Re-trigger cubic
|
|
Heads up @cubic-dev-ai — reverted the warn→error promotion in 45df9ad. CI |
@LucasSantana-Dev Understood — acknowledged. I see the revert in the latest commit (that's the commit 45df9ad you mentioned, which is the most recent one pushed). The diff in To confirm what I'll check against:
I'll keep the review aligned to that scope. The PR description above that still says "promotes" is stale — I'll ignore that and go off the actual file state. Tip: get faster answers by chatting with cubic’s review copilot in the review UI |
#1387) Fast follow-up to #1385. #1385 auto-merged on its **promotion** commit before the revert push landed, so `main` shipped the five `no-unsafe-*` rules at `error` in the bot/shared ratchet block. The CI **`quality / Lint`** job runs `eslint .` **without `db:generate` / `build:shared`**, so those **type-aware** rules emit ~4200 phantom *"type could not be resolved"* / *"error typed"* diagnostics across untouched files — making that (non-required) job permanently red. This sets the five rules back to **`warn`**. The inventory is still 0 (the #1382/#1384/#1385 fixes stand); only the enforcement is deferred. Promotion is gated on **#1386** (make CI lint type-aware: run the Prisma/shared codegen before `eslint .`). Note: `quality / Lint` is not a required check, so `main` still merges/deploys fine — this just restores a green lint signal. Syntactic rules (`import-x/no-duplicates`, etc.) are unaffected and remain at `error`. ## Validation - root lint (typed env) exit 0 - only `eslint.config.js` changed (5 rules `error` → `warn`) <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Set the five `@typescript-eslint` `no-unsafe-*` rules back to `warn` in `eslint.config.js` to avoid false type errors when CI runs `eslint .` without codegen, keeping the `quality / Lint` job green until linting is type-aware. Also updated the inline comment to cite the actual cleanup PRs (#1382/#1384/#1385) and note that promotion to `error` is gated on #1386. <sup>Written for commit a1e71a6. Summary will update on new commits.</sup> <a href="https://cubic.dev/pr/LucasSantana-Dev/Lucky/pull/1387?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
#1392) Closes #1386. ## Problem The reusable `quality / Lint` job ran `eslint .` **without** generating the Prisma client or building `@lucky/shared` first, so the `@typescript-eslint` **type-aware** rules couldn't resolve types and emitted ~4200 phantom diagnostics (`Unsafe call/return/member-access … could not be resolved`) on untouched files (PR #1385: 4336 problems). This blocked the #1378 ratchet from promoting the `no-unsafe-*` family `warn → error`. ## Fix - Bump the `LucasSantana-Dev/.github` reusable-workflow pin `6ec7fbe → aae80785` (adds the optional `pre-lint-script` input + guarded pre-lint step, .github PR #6). - Pass `pre-lint-script: 'npm run db:generate && npm run build:shared'` so eslint has the generated Prisma client and built shared types available before `eslint .`. ## Verification Both root scripts exist; `db:generate` has a `DATABASE_URL` fallback so `prisma generate` runs without a live DB. **Acceptance check:** confirm the `quality / Lint` job on this PR reports 0 phantom "could not be resolved" diagnostics. ## Follow-up Once `quality / Lint` is clean here, a follow-up promotes `no-unsafe-*` `warn → error` in `eslint.config.js` (#1378). @cubic-dev-ai @coderabbitai <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Run `npm run db:generate` and `npm run build:shared` before `eslint .` in the quality lint workflow. This ensures the Prisma client and `@lucky/shared` types exist, so `@typescript-eslint` resolves types and stops emitting phantom "could not be resolved" errors, unblocking the `no-unsafe-*` warn→error change (#1378). <sup>Written for commit 3bd1778. Summary will update on new commits.</sup> <a href="https://cubic.dev/pr/LucasSantana-Dev/Lucky/pull/1392?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Chores * Updated code quality workflow to include database generation and shared library compilation steps before linting checks. <!-- end of auto-generated comment: release notes by coderabbit.ai -->



Part of #1378 (ratchet tail). Clears the last 16
no-unsafe-*warnings (bot handlers), taking the whole family to 0. Typing-only, no behavior change.Fixes
embedDatacame fromJSON.parse(...)(any). Cast the parsed result to the sharedEmbedDatatype and passsetTitle(embedData.title || null)to match discord.js'ssetTitle(string | null).require('../../../client')fallback cast.Promotion deferred (was reverted in this branch)
I initially promoted the five
no-unsafe-*ruleswarn → error, but CI'squality / Lintjob runseslint .withoutdb:generate/build:shared, so the type-aware rules emit ~4200 phantom "type could not be resolved" / "error typed" diagnostics across untouched files. Atwarnthose are silent; aterrorthe job goes permanently red. So the rules stay atwarn; promotion is gated on #1386 (make CI lint type-aware). See the comment block ineslint.config.js.Cumulative across #1382/#1384/this PR: 50
no-unsafe-*→ 0 (cleared; enforcement pending #1386).Validation