meilisearch / scrapix

MIT License
23 stars 9 forks source link

Transform repository into typescript #15

Closed bidoubiwa closed 1 year ago

bidoubiwa commented 1 year ago

TypeScript offers static typing, catching errors at compile-time and improving code reliability. It provides enhanced IDE support, boosting productivity with autocompletion and intelligent code suggestions. Overall, we benefit in time to use typescript.

When running yarn start and yarn serve, instead of running the js file it should first compile the typescript file in javascript files and point to the builder file.

"start": "node build/src/index.js",
"serve": "node build/src/server.js",

The tsconfig rules can be very minimal

{
  "compilerOptions": {
    "target": "esnext",
    "module": "commonjs",
    "strict": true,
    "esModuleInterop": true,
    "outDir": "dist"
  },
  "include": [
    "src/**/*.ts"
  ]
}