Airbnb Standard
Airbnb JavaScript Style flavoured
standard
.
Note: this package and the author are not affiliated with Airbnb!
This module saves you (and others!) time in two ways:
- No configuration. The easiest way to enforce consistent style in your project. Just drop it in.
- Catch style errors before they're submitted in PRs. Saves precious code review time by eliminating back-and-forth between maintainer and contributor.
Install
npm install --only=production --save airbnb-standard
Usage
After you've installed airbnb-standard
, you should be able to use the airbnb-standard
program. The
simplest use case would be checking the style of all JavaScript files in the
current working directory:
$ airbnb-standardError: Use Airbnb JavaScript Style lib/torrent.js:950:11: Expected '===' and instead saw '=='.
You can optionally pass in a directory (or directories) using the glob pattern. Be
sure to quote paths containing glob patterns so that they are expanded by
airbnb-standard
instead of your shell:
$ airbnb-standard "src/util/**/*.js" "test/**/*.js"
Note: by default airbnb-standard
will look for all files matching the patterns:
**/*.js
, **/*.jsx
.
What you might do if you're clever
- Add it to
package.json
- Style is checked automatically when you run
npm test
$ npm testError: Use Airbnb JavaScript Style lib/torrent.js:950:11: Expected '===' and instead saw '=='.
- Never give style feedback on a pull request again!
Rules
This package is simply a fork of standard
with Airbnb's JavaScript Style applied, please consult the Airbnb JavaScript Style Guide for rule details.
How do I ...
This package is simply a fork of standard
with Airbnb's JavaScript Style applied, please consult the standard
README for any questions on usage and configuration.
©️ ahmadnassri.com · License: ISC · Github: @ahmadnassri · Twitter: @ahmadnassri