Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kcalixto/poc-nodejs-setup
https://github.com/kcalixto/poc-nodejs-setup
Last synced: 14 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/kcalixto/poc-nodejs-setup
- Owner: kcalixto
- Created: 2024-02-25T20:31:48.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-02-25T21:09:51.000Z (11 months ago)
- Last Synced: 2024-11-05T23:18:20.614Z (2 months ago)
- Language: TypeScript
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# poc-nodejs-setup
- npm init -y
- yarn add typescript @types/node
- npx tsc --init
- tsconfig.json```json
{
"compilerOptions": {
"target": "es2016",
"module": "commonjs",
"rootDir": "src",
"outDir": "./dist",
"moduleResolution": "node",
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
}
}
```- yarn add -D ts-node nodemon
- added start:dev script```json
"start:dev": "nodemon --watch 'src/' --exec 'ts-node src/index.ts' -e ts"
```- yarn add -D prettier eslint
- npx eslint --init
- To check syntax and find problems
- JavaScript modules (import/export)
- None of these
- Yes
- Node
- JSON
- Yes
- add jest in eslint env```json
"env": {
"es2021": true,
"node": true,
"jest": true
},
```- add tsconfig in eslint
```json
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module",
"project": ["./tsconfig.json"]
},
```- add .prettierrc.json file
```json
{
"semi": false,
"singleQuote": true,
"tabWidth": 2
}
```- yarn add -D eslint-config-prettier
- add prettier in extends```json
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
```