2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

LintAdvent Calendar 2016

Day 12

eslint-config-airbnbをサーバーサイドで使いたい

Last updated at Posted at 2016-12-11

eslint-config-airbnbを普通にNode.jsでExpressとかで使おうとすると、
ReactやJSXなどフロントエンド用のも読み込まれてしまってちょっとうざい

そういうときはeslint-config-airbnb-baseを使う

$ npm i --save-dev eslint eslint-config-airbnb-base

インストールして"extends": "airbnb-base"を指定する

.eslintrc.json
{
    "env": {
        "es6": true,
        "node": true
    },
    "extends": "airbnb-base"
}

これでNode.js用にlintがかかるようになる

$ ./node_modules/.bin/eslint ./
2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?