The Great Typescript Migration (notes)

August 24, 2020

I'm in the process of migrating to Typescript. I will document my notes here. I will update this note throughout the migration.

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

ESLint warning about Typescript 4

MS just released Typescript 4 last week. Eslint will push their weekly release at 2am Singapore time tomorrow which will support Typescript 4.

Try and catch in Typescript: No type annotations yet

Discussed since 2017, may be implemented. For now, check for type in catch bracket.

Type safe usage of auto generated functions for sequelize-typescript

Sequelize generates methods for models with relationships. In sequelize-typescript, use $set(model, instance) or $get() etc instead.

TypeError: Cannot read property 'getQueryInterface' of undefined

Downgrade to sequelize@5.22.3 temporarily. See discussion.