Guardian icon indicating copy to clipboard operation
Guardian copied to clipboard

Revert everything to Typescript

Open brennanmhr06 opened this issue 9 months ago • 5 comments

Typescript for this project, would be better.

brennanmhr06 avatar Mar 04 '26 00:03 brennanmhr06

Agreed, TypeScript definitely is the modern choice.

lunaradev1 avatar Mar 04 '26 00:03 lunaradev1

Hi 👋

I would love to work on converting the project back to TypeScript.

Before I start, could you please confirm:

  • Should all .js files 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 🙂

selvaganapathycoder avatar Mar 04 '26 08:03 selvaganapathycoder

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 .js files to .ts files. Potentially .mts if 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

lunaradev1 avatar Mar 04 '26 15:03 lunaradev1

^

brennanmhr06 avatar Mar 04 '26 16:03 brennanmhr06

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

brennanmhr06 avatar Mar 05 '26 05:03 brennanmhr06