Skip to content

Instantly share code, notes, and snippets.

@codespool
Last active October 2, 2018 11:29
Show Gist options
  • Save codespool/e8cbf4de51b39471ed60cc3932ff99ed to your computer and use it in GitHub Desktop.
Save codespool/e8cbf4de51b39471ed60cc3932ff99ed to your computer and use it in GitHub Desktop.
Adds all needed codestyle dependencies
#!/bin/bash
#####################################
# npm 5+ required
# run in the root of your npm project
# edit env as needed (browser or node)
#####################################
npm i -D eslint prettier eslint eslint-config-prettier eslint-plugin-prettier babel-eslint@8
npx install-peerdeps --dev eslint-config-airbnb
echo '{
"parser": "babel-eslint",
"env": {
"browser": true,
"node": true
}
"extends": ["airbnb", "prettier"],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": ["error"],
"react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }]
}
}' > .eslintrc
echo '{
"singleQuote": true,
"trailingComma": "es5"
}' > .prettierrc
@codespool
Copy link
Author

copy this file to the root of your project, make it executable and run it once:

cd /path/to/my/project
cp /path/to/codestyle_init.sh .
chmod +x codestyle_init.sh
./codestyle_init.sh

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