Revert everything to Typescript
Typescript for this project, would be better.
Agreed, TypeScript definitely is the modern choice.
Hi 👋
I would love to work on converting the project back to TypeScript.
Before I start, could you please confirm:
- Should all
.jsfiles be converted to.ts/.tsx? - Do we need strict mode enabled?
- Is there any specific TypeScript configuration preferred?
Happy to take this up once confirmed 🙂
Hello @selvaganapathycoder, I am a second developer of the project. One that's hopefully also gonna make the codebase more modern. I'm filling in for @brennanmhr06 for right now due to his internet going kaput. I can answer your questions as a TypeScript person myself.
- Yes, we're hopefully planning to move
.jsfiles to.tsfiles. Potentially.mtsif needed, we're moving to ESM. We're also probably gonna migrate to Bun. - Strict mode should be on, I'll share a basic idea of what the config could look like based on my projects, which are usually extremely strict.
- And for the final question, this is the config for my project, I'm also probably gonna be moving the project to MikroORM, so... decorators may be used in the future. This should be a good starting point for rewriting.
{
"compilerOptions": {
// Environment setup & latest features
"lib": ["ESNext"],
"target": "ESNext",
"module": "preserve",
"moduleDetection": "force",
"jsx": "react-jsx",
"allowJs": true,
"checkJs": true,
// Bundler mode
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,
"noEmitOnError": true,
// Best practices
"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,
// Some stricter flags (disabled by default)
"noUnusedLocals": true,
"noUnusedParameters": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitAny": true,
"noImplicitThis": true,
"noImplicitReturns": true,
// Needed for MikroORM
"emitDecoratorMetadata": true,
"experimentalDecorators": true
}
}
Feel free to reach out to me for anything, preferably on Discord if possible. I can set up a live share session so we can get this done together.
- LunaraDev <3
^
Hello @selvaganapathycoder -- Everything Lunara has said, is what i wanted to say but my internet was bugging out earlier for hours. Were going to revert everything to typescript under a new branch -- We'd like to talk about it more with you on Discord via text.
My discord username: rockyrocksrock