Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ESLint入門

Avatar for tanmen tanmen
February 04, 2016
160

 ESLint入門

社内勉強会でESLintについて話しました。
デモメインだったのでスライド見てもよくわからないです。

Avatar for tanmen

tanmen

February 04, 2016
Tweet

Transcript

  1. ESLintとは • JavaScriptの構文チェックツール - 宣言されたが使われてない変数 - 関数名の重複 - …. •

    全てのルールでon/off • Pluggable • ES6, 7とJSXもサポート • その他ツール - JSLint - JSHint (JSLintをフォークしてる)
  2. Philosophy Everything is pluggable: • Rule API is used both

    by bundled and custom rules • Formatter API is used both by bundled and custom formatters • Additional rules and formatters can be specified at runtime • Rules and formatters don't have to be bundled to be used Every rule: • Is standalone • Can be able to be turned off or on (nothing can be deemed "too important to turn off") • Can be set to be a warning or error individually • Is turned on by providing a non-zero number and off by providing zero Additionally: • Rules are "agenda free" - ESLint does not promote any particular coding style • Any bundled rules are generalizable The project: • Values documentation and clear communication • Is as transparent as possible • Believes in the importance of testing
  3. 動かしてみる • nvmとNode.jsをインストール • esintインストール - npm install -g eslint

    ・設定ファイル生成 - eslint --init ・独自ルール追加 - rule作る - 設定ファイルに追加