Skip to content

Instantly share code, notes, and snippets.

@zhangtaihao
Last active August 13, 2018 07:15
Show Gist options
  • Save zhangtaihao/015e40021aaf1da6bacdc34dbb1b8f06 to your computer and use it in GitHub Desktop.
Save zhangtaihao/015e40021aaf1da6bacdc34dbb1b8f06 to your computer and use it in GitHub Desktop.
Init JS project with Airbnb style guide
#!/bin/sh
DEFAULT_GITIGNORE='.idea\nnode_modules'
DEFAULT_ESLINTIGNORE='node_modules'
DEFAULT_ESLINTRC='{"parser":"babel-eslint","extends":"airbnb","plugins":["prefer-object-spread"],"rules":{"prefer-object-spread/prefer-object-spread":2}}'
DEFAULT_BABELRC='{"presets":["env"]}'
git init
npm init -y
npm i -D babel-eslint eslint-plugin-prefer-object-spread jest babel-jest
npx install-peerdeps --dev eslint-config-airbnb
echo $DEFAULT_ESLINTRC > .eslintrc
echo $DEFAULT_ESLINTIGNORE > .eslintignore
echo $DEFAULT_GITIGNORE > .gitignore
echo $DEFAULT_BABELRC > .babelrc
touch index.js
jest --init
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment