Last active
March 10, 2020 08:13
-
-
Save MelodicCrypter/3a315f8a510de05bce8b36d6ea92c9c6 to your computer and use it in GitHub Desktop.
Common development setup for NodeJS projects: Babel, ESLint, Prettier, etc.
This file contains 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
{ | |
"presets": [ | |
"@babel/preset-env" | |
] | |
} |
This file contains 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
{ | |
"env": { | |
"browser": true, | |
"node": true, | |
"es6": true, | |
"jquery": true, | |
"mocha": true | |
}, | |
"plugins": [ | |
"prettier" | |
], | |
"extends": [ | |
"airbnb", | |
"prettier", | |
"plugin:prettier/recommended", | |
], | |
"rules": { | |
"no-unused-vars": [1, { "argsIgnorePattern": "res|next|^err" }], | |
"arrow-body-style": [2, "as-needed"], | |
"no-param-reassign": [2, { "props": false }], | |
"no-console": 0, | |
"import": 0, | |
"func-names": 0, | |
"space-before-function-paren": 0, | |
"comma-dangle": 0, | |
"max-len": 0, | |
"no-underscore-dangle": 0, | |
"consistent-return": 0, | |
"react/prefer-es6-class": 0, | |
"radix": 0, | |
"indent": ["error", 4] | |
} | |
} |
This file contains 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
{ | |
"endOfLine": "lf", | |
"tabWidth": 4, | |
"printWidth": 120, | |
"trailingComma": "all", | |
"semi": true, | |
"singleQuote": true | |
} |
This file contains 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
"scripts": { | |
"clean": "rm -rf build && mkdir build", | |
"build-babel": "babel -d ./build ./src -s", | |
"dev": "nodemon --exec babel-node src/server.js", | |
"build": "yarn clean && yarn build-babel", | |
"start": "yarn build && node ./build/server.js" | |
}, |
This file contains 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
# Add all as devDependencies | |
yarn add -D @babel/cli @babel/node @babel/core @babel/preset-env babel-eslint eslint eslint-config-airbnb eslint-config-prettier eslint-plugin-import eslint-plugin-prettier eslint-loader prettier pretty-quick | |
# For Heroku deployments, there are some changes | |
yarn add @babel/cli @babel/plugin-transform-runtime @babel/preset-env @babel/runtime && yarn add -D @babel/node @babel/core babel-eslint eslint eslint-config-airbnb eslint-config-prettier eslint-plugin-import eslint-plugin-prettier eslint-loader prettier pretty-quick | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment