0.5.1 • Published 4 years ago

eslint-config-pixta v0.5.1

Weekly downloads
325
License
MIT
Repository
github
Last release
4 years ago

eslint-config-pixta npm version

This package provides PIXTA's .eslintrc as an extensible shared config.

Usage

  1. Execute npm install --save-dev eslint-config-pixta eslint-plugin-import
  2. Add "extends": "pixta" to your .eslintrc

Sample

{
  "env": {
    "browser": true
  },
  "extends": [
    "pixta"
  ],
  "globals": {
    "gon": true
  }
}

Rules

Our style guide is based on:

Only differences from base rules are shown below.

未使用引数の先頭には_を付ける (no-unused-vars)

デフォルト設定では、未使用の引数の存在をそもそも許さない。 ピクスタでは、インターフェースを明示するために未使用引数の利用を許す。 ただし、その際には先頭に_を付与しなくてはならない。

// bad
function foo(x, y) {
    return x + 1;
}

// good
function foo(x, _y) {
    return x + 1;
}

プライベートメソッドの先頭には_を付ける (no-underscore-dangle)

JavaScript のオブジェクトのメソッドには public/private を定義できない。 プライベートメソッドだと明示するために、先頭には_を付けることとする。

// bad
class Foo {
  bar () { // bar は private メソッドを想定
    ..
  }
}

// good
class Foo {
  _bar () { // bar は private メソッドを想定
    ..
  }
}
0.5.1

4 years ago

0.5.0

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.2

7 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.1

8 years ago