Summary of Module 1
This lesson is a summary of the work we've done in Module 1.0.
This lesson is a summary of what we've done in Module 1.0.
In Module 1.0, we've built a very simple Node/Express/Typescript project.
package.json
#
In the package.json
file of our app, we can see the dependencies
and devDependencies
our app depends on. body-parser
and the express
packages are our app's main dependencies. In our development dependencies, we've introduced the TypeScript ESLint packages, the eslint
package, nodemon
, and typescript
. We've introduced two scripts in our app; the start
script which allows us to start the server and the build
script which allows us to compile our TypeScript code to valid JavaScript.
xxxxxxxxxx
{
"name": "tinyhouse-v1-server",
"version": "0.1.0",
"dependencies": {
"body-parser": "^1.19.0",
"express": "^4.17.1"
},
"devDependencies": {
"@types/body-parser": "^1.17.0",
"@types/express": "^4.17.0",
"@types/node": "^12.0.10",
"@typescript-eslint/eslint-plugin": "^1.11.0",
"@typescript-eslint/parser": "^1.11.0",
"eslint": "^6.0.1",
"nodemon": "^1.19.1",
"ts-node": "^8.3.0",
"typescript": "^3.5.2"
},
"scripts": {
"start": "nodemon src/index.ts",
"build": "tsc -p ./"
}
}
.eslintrc.json
#
The .eslintrc.json
file sets up the configuration for our ESLint setup. We're using the @typescript-eslint/parser
package to help parse TypeScript code. We're extending the @typescript-eslint/recommended
package which contains a series of recommended rules. We've also added and customized a few rules of our own.
xxxxxxxxxx
{
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"extends": ["plugin:@typescript-eslint/recommended"],
"env": { "node": true },
"rules": {
"indent": "off",
"@typescript-eslint/indent": "off",
"@typescript-eslint/explicit-function-return-type": "off"
}
}
tsconfig.json
#
This lesson preview is part of the TinyHouse: A Fullstack React Masterclass with TypeScript and GraphQL course and can be unlocked immediately with a single-time purchase. Already have access to this course? Log in here.
Get unlimited access to TinyHouse: A Fullstack React Masterclass with TypeScript and GraphQL with a single-time purchase.
