fix: set explicit non-permanent redirects#2238
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughFour onboarding redirects now explicitly set ChangesRedirect permanence enforcement
🎯 2 (Simple) | ⏱️ ~10 minutes
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
scripts/check-redirects.mjs (1)
95-104: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winSync the shared redirect typedef with this new invariant.
scripts/common.mjs:391-407still documentspermanentas optional, but this checker now rejects any redirect without a booleanpermanent. Tightening that JSDoc topermanent: booleanwill keep the shared contract aligned with the runtime rule.Suggested follow-up
/** * Get redirect objects from the docs.json configuration. * * `@typedef` {{ * source: string; * destination: string; - * permanent?: boolean | undefined + * permanent: boolean * }} Redirect * `@param` config {DocsConfig} * `@returns` {Redirect[]} */🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/check-redirects.mjs` around lines 95 - 104, The redirect contract is now stricter than the shared typedef: `check-redirects.mjs` rejects any redirect whose `permanent` is missing or non-boolean, but `scripts/common.mjs` still documents it as optional. Update the shared redirect JSDoc/type for the redirect object (the `permanent` field in the common redirect schema) to require `boolean` instead of optional, so it matches the validation enforced by `composeErrorList` in `check-redirects.mjs`.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@scripts/check-redirects.mjs`:
- Around line 95-104: The redirect contract is now stricter than the shared
typedef: `check-redirects.mjs` rejects any redirect whose `permanent` is missing
or non-boolean, but `scripts/common.mjs` still documents it as optional. Update
the shared redirect JSDoc/type for the redirect object (the `permanent` field in
the common redirect schema) to require `boolean` instead of optional, so it
matches the validation enforced by `composeErrorList` in `check-redirects.mjs`.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 5186ec5a-8765-434c-89d4-80aae80a475e
📒 Files selected for processing (2)
docs.jsonscripts/check-redirects.mjs
Summary by CodeRabbit