1.0.0 • Published 7 years ago

airbnb-standard v1.0.0

Weekly downloads
128
License
MIT
Repository
github
Last release
7 years ago

Airbnb Standard version License

Airbnb JavaScript Style flavoured standard.

Build Status Downloads Code Climate Coverage Status Dependency Status Dependencies

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-standard
Error: 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

  1. Add it to package.json

    {
      "name": "my-cool-package",
      "devDependencies": {
        "airbnb-standard": "*"
      },
      "scripts": {
        "pretest": "airbnb-standard",
        "test": "node my-tests.js"
      }
    }
  2. Style is checked automatically when you run npm test

    $ npm test
    Error: Use Airbnb JavaScript Style
      lib/torrent.js:950:11: Expected '===' and instead saw '=='.
  3. 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.


:copyright: ahmadnassri.com  ·  License: ISC  ·  Github: @ahmadnassri  ·  Twitter: @ahmadnassri