-
Notifications
You must be signed in to change notification settings - Fork 0
Home
I'm going to use this wiki page to document all the necesary steps to reproduce this project ๐
Install express and its types:
npm install expressnpm install --save @types/expressInstall typescript and its types:
npm i -D typescript @types/express @types/nodeInstall eslint with typescript dependencies:
sudo npm install -g eslintnpm i -D typescript @typescript-eslint/parser @typescript-eslint/eslint-pluginCreate .eslintrc file in the root of your project and paste this code inside:
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"rules": {
"semi": ["error", "always"],
"quotes": [2, "single"]
}
}Install this VSCode extension to teach it to understand eslint.
And last but not least, paste this code to VSCode settings.json
{
"eslint.validate": ["typescript"]
}Lint all files with:
eslint --ext ts .Install mongoose:
npm install mongoosenpm install @types/mongoose --save-devInstall cors:
npm install corsnpm i --save-dev @types/corsAnd modify the index.ts to include the following sentences
import cors from 'cors';
app.use(express.json());
app.use(cors());Install tsyringe
npm install --save tsyringeAnd modify the tsconfig.json to include the following settings
{
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true
}
}Install jest
npm install --save-dev jest ts-jest @types/jestGenerate config file for ts-jest
npx ts-jest config:initCreate a script in package.json
{
test: "jest"
}Made with love by los pibes โค
What should do I put here? ๐
For any question meet me at Wir Konnen ๐ป