Skip to content

feat(core): migrate cards/gist to TypeScript#365

Closed
shaurya-sharma-dev wants to merge 2 commits into
stats-organization:masterfrom
shaurya-sharma-dev:master
Closed

feat(core): migrate cards/gist to TypeScript#365
shaurya-sharma-dev wants to merge 2 commits into
stats-organization:masterfrom
shaurya-sharma-dev:master

Conversation

@shaurya-sharma-dev

@shaurya-sharma-dev shaurya-sharma-dev commented Jul 14, 2026

Copy link
Copy Markdown

This pull requests continues #140 by migrating cards/gist to TypeScript.

Note: There was an error where TypeScript raised the following error:

argument of type number | undefined is not assignable to parameter of type number

To fix this, I modified common/Card.ts to add | undefined to the border_radius parameter typehint.

(Edit: Separate error message more clearly.)

@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

@shaurya-sharma-dev is attempting to deploy a commit to the martin-mfg's projects Team on Vercel.

A member of the Team first needs to authorize it.

@marcalexiei marcalexiei left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,

I'm already working on migrating the core package to TypeScript (#140), which is now assigned to me.
So there's no need to take over that task.

Superseded by #370

Comment on lines +132 to +136
// @ts-expect-error Stops TypeScript from raising error.
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- Suppressing the resulting error-any
const languageColor = languageColors[languageName] || "#858585";

// eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- Suppressing the resulting error-any

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI the three suppressions have the same root cause: languageColors.json is inferred with literal keys and no index signature, so languageColors[languageName] causes a type error.

Casting languageName to the correct key type would remove the need for all three suppressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants