Skip to content

Instantly share code, notes, and snippets.

@amadden80
Last active August 30, 2016 16:19
Show Gist options
  • Save amadden80/056d9f827a35b8671687dbec8162fb88 to your computer and use it in GitHub Desktop.
Save amadden80/056d9f827a35b8671687dbec8162fb88 to your computer and use it in GitHub Desktop.
function prepEsLinter() {
if [ -f "package.json" ]; then
echo "PackJSON alright there!!!"
else
echo "Creating a default package.json... might want to edit this!"
npm init -f
fi
(
export PKG=eslint-config-airbnb;
npm info "$PKG" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG"
echo "\"extends\": \"airbnb\"" > .eslintrc
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment