Upgrade ESLint and fix no-unused-vars mapped type errors#8050
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Dependency Review✅ No vulnerabilities found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. Scanned Files
|
Replace mapped type syntax ([key in X]: Y) with Record<X, Y> utility types to satisfy the stricter @typescript-eslint/no-unused-vars rule in the upgraded ESLint version. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
c29aad3 to
6746b2e
Compare
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.
Description Of Changes
Upgrades ESLint in admin-ui and fixes the 5
@typescript-eslint/no-unused-varserrors introduced by the stricter rule. The newer ESLint now flags mapped type index variables (e.g.[K in SomeType]) as "defined but never used."The fix replaces mapped type syntax with the equivalent
Record<>/Partial<Record<>>utility types, which avoids declaring an index variable entirely.Code Changes
clients/admin-ui/package.json(+ lockfile)RequestStatusBadge.tsx:{ [_status in PrivacyRequestStatus]: ... }→Record<PrivacyRequestStatus, ...>allIntegrationTypes.tsx:{ [K in ConnectionType]?: ... }→Partial<Record<ConnectionType, ...>>helpers.tsx:{ [Property in keyof ExperienceTranslationCreate]?: ... }→Partial<Record<keyof ExperienceTranslationCreate, ...>>cells.tsx:{ [key in PrivacyRequestStatus]: ... }→Record<PrivacyRequestStatus, ...>MultipleSystemsFilterModal.tsx:{ [key in keyof typeof VendorSources]: ... }→Record<keyof typeof VendorSources, ...>Steps to Confirm
Pre-Merge Checklist
CHANGELOG.mdupdated🤖 Generated with Claude Code