npm install typescript -D -E
"scripts": {
"tsc": "tsc"
}
This generates the code JS for prod
npm run tsc -- --init
npm install @types/express -D -E
npm install ts-node-dev -D -E
"scripts": {
"dev": "ts-node-dev src/index.ts"
}
npm install ts-standard -D -E
"scripts": {
"lint": "ts-standard"
}
and add in the packa.json
:
"eslintConfig": {
"parserOptions": {
"project": "./tsconfig.json"
},
"extends": [
"./node_modules/ts-standard/eslintrc.json"
]
}
Check if eslint is configured correctly
Require Node.js 18.x
npm install
to install the dependenciesnpm run dev
to run development mode appnpm start
to build production
https://blog.logrocket.com/how-to-set-up-node-typescript-express/