Skip to content

Commit fb007e7

Browse files
ericyangpanclaude
andcommitted
refactor: improve type safety and remove type assertions
- Remove 'as any' type assertion in vendor page, add proper ManifestModel typing - Prefix unused error variable with underscore to follow linting best practices 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 9aaa830 commit fb007e7

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.claude/skills/manifest-creator/scripts/create.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ try {
5151
console.error('❌ Error: URL must use HTTPS protocol')
5252
process.exit(1)
5353
}
54-
} catch (error) {
54+
} catch (_error) {
5555
console.error(`❌ Error: Invalid URL format: ${url}`)
5656
process.exit(1)
5757
}

src/app/[locale]/vendors/[slug]/page.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,13 @@ import {
1818
} from '@/lib/generated'
1919
import { localizeManifestItem, localizeManifestItems } from '@/lib/manifest-i18n'
2020
import { generateSoftwareDetailMetadata } from '@/lib/metadata'
21-
import type { ManifestCLI, ManifestExtension, ManifestIDE, ManifestVendor } from '@/types/manifests'
21+
import type {
22+
ManifestCLI,
23+
ManifestExtension,
24+
ManifestIDE,
25+
ManifestModel,
26+
ManifestVendor,
27+
} from '@/types/manifests'
2228

2329
export const revalidate = 3600
2430

@@ -120,7 +126,7 @@ export default async function VendorPage({
120126
const vendorModels = localizeManifestItems(
121127
models.filter(model => model.vendor === vendor.name) as unknown as Record<string, unknown>[],
122128
locale as Locale
123-
)
129+
) as ManifestModel[]
124130

125131
// Schema.org structured data
126132
const organizationSchema = {
@@ -178,7 +184,7 @@ export default async function VendorPage({
178184
<VendorProducts products={vendorProducts} locale={locale} title={t('products')} />
179185

180186
{/* Vendor Models */}
181-
<VendorModels models={vendorModels as any} locale={locale} title={t('models')} />
187+
<VendorModels models={vendorModels} locale={locale} title={t('models')} />
182188

183189
{/* Navigation */}
184190
<BackToNavigation href="vendors" title={t('allVendors')} />

0 commit comments

Comments
 (0)