-
Notifications
You must be signed in to change notification settings - Fork 97
chore: upgrade to TypeScript 6.0.3 and clean up legacy patterns #1295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,8 +10,7 @@ interface ListObjectsRequestViewerOpts { | |
| objectType: string; | ||
| contextualTuples?: TupleKey[]; | ||
|
|
||
| // eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
| context?: Record<string, any>; | ||
| context?: Record<string, unknown>; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Several SDK branches quote 🤖 Prompt for AI Agents |
||
| expectedResults: string[]; | ||
| skipSetup?: boolean; | ||
| pseudoCodeMode?: boolean; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export type LottieAnimationData = Record<string, unknown>; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,15 @@ interface GithubStarsSessionStorage { | |
| retrievedTime: number; | ||
| } | ||
|
|
||
| function readCachedGithubStars(): GithubStarsSessionStorage | null { | ||
| const raw = sessionStorage.getItem(GITHUB_STARS_SESSION_STORAGE_NAME); | ||
| if (!raw) { | ||
| return null; | ||
| } | ||
| const parsed = JSON.parse(raw); | ||
| return typeof parsed?.count === 'number' && typeof parsed?.retrievedTime === 'number' ? parsed : null; | ||
| } | ||
|
Comment on lines
+16
to
+23
Comment on lines
+16
to
+23
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win Guard cache parsing/storage access so errors don’t escape
🛡️ Proposed fix function readCachedGithubStars(): GithubStarsSessionStorage | null {
- const raw = sessionStorage.getItem(GITHUB_STARS_SESSION_STORAGE_NAME);
- if (!raw) {
+ try {
+ const raw = sessionStorage.getItem(GITHUB_STARS_SESSION_STORAGE_NAME);
+ if (!raw) {
+ return null;
+ }
+ const parsed: unknown = JSON.parse(raw);
+ if (
+ typeof parsed === 'object' &&
+ parsed !== null &&
+ typeof (parsed as { count?: unknown }).count === 'number' &&
+ typeof (parsed as { retrievedTime?: unknown }).retrievedTime === 'number'
+ ) {
+ return parsed as GithubStarsSessionStorage;
+ }
return null;
+ } catch {
+ return null;
}
- const parsed = JSON.parse(raw);
- return typeof parsed?.count === 'number' && typeof parsed?.retrievedTime === 'number' ? parsed : null;
}Also applies to: 47-47 🤖 Prompt for AI Agents |
||
|
|
||
| export default function NavbarNavLink({ | ||
| activeBasePath, | ||
| activeBaseRegex, | ||
|
|
@@ -35,9 +44,7 @@ export default function NavbarNavLink({ | |
|
|
||
| useEffect(() => { | ||
| const getData = async () => { | ||
| const cachedGithubStars = JSON.parse( | ||
| sessionStorage.getItem(GITHUB_STARS_SESSION_STORAGE_NAME), | ||
| ) as unknown as GithubStarsSessionStorage; | ||
| const cachedGithubStars = readCachedGithubStars(); | ||
| try { | ||
| if (cachedGithubStars) { | ||
| const cacheExpiryTime = new Date(cachedGithubStars.retrievedTime); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Serializer coverage is incomplete for declared
JsonValueinputs.JsonValueincludesnulland arrays, butpyValue/goValue/javaValue/csharpValuedon’t consistently emit valid literals for those cases, so some generated snippets become invalid or semantically wrong.💡 Suggested fix
function pyValue(val: JsonValue, indent: number): string { + if (val === null) return 'None'; if (typeof val === 'string') return `"${val}"`; if (typeof val === 'number') return String(val); if (typeof val === 'boolean') return val ? 'True' : 'False'; @@ function goValue(val: JsonValue, indent: number): string { + if (val === null) return 'nil'; if (typeof val === 'string') return `"${val}"`; if (typeof val === 'number' || typeof val === 'boolean') return String(val); + if (Array.isArray(val)) { + const items = val.map((v) => goValue(v, indent + 4)); + return `[]interface{}{${items.join(', ')}}`; + } if (typeof val === 'object' && val !== null) { @@ function javaValue(val: JsonValue, indent: number): string { + if (val === null) return 'null'; if (typeof val === 'string') return `"${val}"`; if (typeof val === 'number' || typeof val === 'boolean') return String(val); + if (Array.isArray(val)) { + const items = val.map((v) => javaValue(v, indent + 4)); + return `List.of(${items.join(', ')})`; + } if (typeof val === 'object' && val !== null) { @@ function csharpValue(val: JsonValue, indent: number): string { + if (val === null) return 'null'; if (typeof val === 'string') return `"${val}"`; if (typeof val === 'number' || typeof val === 'boolean') return String(val).toLowerCase(); + if (Array.isArray(val)) { + const items = val.map((v) => csharpValue(v, indent + 4)); + return `new[] { ${items.join(', ')} }`; + } if (typeof val === 'object' && val !== null) {Also applies to: 27-27, 44-44, 56-56, 68-68
🤖 Prompt for AI Agents