Skip to content

Instantly share code, notes, and snippets.

@matheusnascgomes
Last active October 2, 2019 01:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matheusnascgomes/10488cd33bce5ae1a32a4821962d8117 to your computer and use it in GitHub Desktop.
Save matheusnascgomes/10488cd33bce5ae1a32a4821962d8117 to your computer and use it in GitHub Desktop.
Eslint and nodemon config for Typescript + NodeJS a
module.exports = {
parser: '@typescript-eslint/parser',
env: {
es6: true,
node: true
},
plugins: ['@typescript-eslint'],
extends: [
'plugin:@typescript-eslint/recommended',
'prettier/@typescript-eslint',
'standard'
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module'
},
rules: {}
}
{
"watch": ["src"],
"execMap": {
"ts": "sucrase-node src/server.ts"
},
"ext": "ts"
}
@matheusnascgomes
Copy link
Author

matheusnascgomes commented Oct 2, 2019

yarn add -D typescript sucrase

Em scripts

  • sucrase-node src/index.ts

yarn add -D nodemon

Criar arquivo nodemon.json

Configurando linter

  • yarn add -D eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin
  • yarn eslint --init (usar standard no node)

Ajustar .eslintrc.js

yarn add -D prettier eslint-config-prettier eslint-plugin-prettier

https://www.youtube.com/watch?v=aTf8QTjw4RE&t=439s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment