Skip to content

Porting from JavaScript to TypeScript#8

Draft
chrisnew wants to merge 62 commits intomainfrom
typescript
Draft

Porting from JavaScript to TypeScript#8
chrisnew wants to merge 62 commits intomainfrom
typescript

Conversation

@chrisnew
Copy link
Copy Markdown
Member

@chrisnew chrisnew commented Apr 4, 2026

It started with eslint in VS Code being more antsy about TypeScript issues recently. So I drafted a set of guidelines and rules on how to port from JavaScript to TypeScript and let GPT 5.4 as well as Claude Opus 4.6 do the heavy lifting.

Each commit represents an iteration of Opus 4.6 coming up with what to port next and GPT 5.4 doing the leg work and me smoke testing and reviewing the code each time. Sometimes I had to git reset between commits, because the code was rendered unusable or the porting effort were too complicated.

The biggest issue the LLMs agents had were to work the way around some quirky JavaScript code the code base employs: Variables changing type, dealing with detecting at run time what to do next etc. GPT 5.4 loves to introduce helper functions to deal with recurring TypeScript casting and it loves to chain casts with types/interfaces together with anonymous types. Multiple times I had to remind it to not introduce unnecessary function calls in hot code paths.

On a positive note: A few bugs have been spotted and fixed as well, no more too verbose code with JSDoc syntax and no more red markings all over the place due to static analysis predicting issues such as accessing missing properties or potentially run into nulls and undefineds.

@chrisnew chrisnew changed the title Typescript Porting from JavaScript to TypeScript Apr 4, 2026
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.

1 participant