Skip to content

Instantly share code, notes, and snippets.

@mladenoff
Last active September 20, 2017 04:12
Show Gist options
  • Save mladenoff/0f6b3bcefd64787f4677c54faf539785 to your computer and use it in GitHub Desktop.
Save mladenoff/0f6b3bcefd64787f4677c54faf539785 to your computer and use it in GitHub Desktop.
AIrbnb linter setup for your full-stack project

The following will set up the fabled Airbnb JavaScript linter for your project. There will be a lot of red at first, but then there will be harmony and beauty.

Paste this command in your project directory:

~/full-stack$ (export PKG=eslint-config-airbnb; 
npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@latest"
)

When that finishes, run this in the same directory:

~/full-stack$ echo "extends: airbnb" > ".eslintrc"

NB: you will not be able to follow it in files that require ES5 syntax (those that aren't transpiled by Babel). You'll just have to deal with the red.

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