JSPM

  • Created
  • Published
  • Downloads 1253
  • Score
    100M100P100Q112764F
  • License MIT

Airbnb's JS ESLint config + JS Standard Style + semicolons

Package Exports

  • eslint-config-airbnb-standard

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (eslint-config-airbnb-standard) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Airbnb+ JavaScript Standard Style

ESLint config "extends": ["airbnb", "standard"]

This is an original Airbnb style guide config extended with JavaScript Standard config (with semicolons).

See airbnb/javascript and standardjs for more information.

Compare configs.

Installation

Yo can install it locally as a dev dependency to use with .eslintrc file:

npm install --save-dev eslint-config-airbnb-standard

But you might need a global solution... read next.

IDE and Editors

Or you can clone the repo to your "Projects" folder to use with WebStorm:

cd ~/Projects
git clone https://github.com/doasync/eslint-config-airbnb-standard.git
cd eslint-config-airbnb-standard
npm install

You can also make eslint global after installing (see above):

Linux:

ln -s $(pwd -P)/node_modules/.bin/eslint $(npm bin -g)

Windows:

for /f "usebackq" %F in (`npm bin -g`) do mklink "%F\eslint.cmd" "%cd%\node_modules\.bin\eslint.cmd"
for /f "usebackq" %F in (`npm bin -g`) do mklink /D "%F/../eslint" "%cd%/node_modules/eslint"

FYI: These commands create a symlink for eslint installed in node_modules

Then check eslint version with:

eslint -v

WebStorm

File | Settings | Languages and Frameworks | JavaScript | Code Quality Tools | ESLint

ESLint settings

Sublime Text 3

  1. Install the repo, [make](IDE and Editors) eslint global, check eslint -v

  2. Go to: Preferences -> Package Control -> install package

  3. Install SublimeLinter

  4. Install SublimeLinter-contrib-eslint

  5. Run:

    npm bin -g

    ... and copy the path

  6. Go to: Tools -> SublimeLinter -> Open User Settings

    Paste the path to NodeJS installation folder inside "paths" for your OS, for example:

    "paths": {
        "linux": [
            "~/.nvm/versions/node/v8.1.2/bin"
        ],
        "osx": [],
        "windows": ["%AppData%\\npm"]
    },
  7. Create .eslintrc file inside your working project:

    {
      "extends": ["airbnb", "standard"],
      "rules": {
        "semi": [2, "always"],
        "object-curly-spacing": [2, "never"]
      }
    }

    Or just copy .eslintrc from the cloned repo

  8. Go to Tools -> SublimeLinter -> Lint this view

  9. PROFIT!!!

Example

Custom Config

You can turn off semicolons in .eslintrc (semi -> "never"):

{
  "extends": ["airbnb", "standard"],
  "rules": {
    "semi": ["error", "never"],
    "object-curly-spacing": ["error", "never"]
  }
}

I want that Sublime Text

You can setup full featured nice black Sublime Text 3 using this repo: sublime-text-3-settings