Last active
February 27, 2019 00:36
-
-
Save lucasecdb/948c103849ed99015b900ab928b050f3 to your computer and use it in GitHub Desktop.
Migrate node app to typescript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"extends": [ | |
"plugin:@typescript-eslint/recommended", | |
"eslint:recommended", | |
"plugin:prettier/recommended", | |
"prettier/@typescript-eslint" | |
], | |
"plugins": ["prettier", "@typescript-eslint"], | |
"env": { | |
"es6": true, | |
"node": true, | |
"browser": false | |
}, | |
"parser": "@typescript-eslint/parser", | |
"rules": { | |
"no-underscore-dangle": [1, { "allow": ["_id"] }], | |
"semi": ["error", "never"], | |
"quotes": ["error", "single"], | |
"comma-dangle": ["error", "always-multiline"], | |
"no-console": "off" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
yarn add -D @types/node \ | |
@types/express \ | |
@types/bcrypt \ | |
@types/bodyparser \ | |
@types/cookie-parser \ | |
@types/graphql \ | |
"types/npm-ramda#dist" \ | |
@typescript-eslint/eslint-plugin \ | |
@typescript-eslint/parser \ | |
concurrently \ | |
eslint \ | |
eslint-config-prettier \ | |
eslint-plugin-prettier \ | |
nodemon \ | |
prettier \ | |
typescript | |
echo "Add the following \"start\" script: concurrently -k -p \\\"[{name}]\\\" -n \\\"TypeScript,Node\\\" -c \\\"cyan.bold,green.bold\\\" \\\"yarn watch-ts\\\" \\\"yarn watch-node\\\"" | |
echo "Add the following \"watch-ts\" script: tsc --watch" | |
echo "Add the following \"watch-node\" script: nodemon dist/index.js" | |
echo "Add the following \"build\" script: tsc" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"compilerOptions": { | |
"module": "commonjs", | |
"esModuleInterop": true, | |
"target": "es6", | |
"noImplicitAny": true, | |
"moduleResolution": "node", | |
"sourceMap": true, | |
"outDir": "dist", | |
"baseUrl": ".", | |
"paths": { | |
"*": ["node_modules/*", "types/*"] | |
} | |
}, | |
"include": ["**/*"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment