How to set up ESLint in Atom so you can contribute to Open Source

Shuma Mizuno
Sep 7, 2018 · 3 min read

学習日: 180907
所要時間: 1時間

What exactly is linting?

エラーが起こる可能性があるコードを分析するプログラム
を実行するプロセス。

What is ESLint?

ESLintはJavaScriptのためのlintingツール。

Why use ESLint?

lintingルール(スタイルガイドやEcma Internationalが定める仕様)にあわせてエラーなどを早期に検出し、コードをクリーンな状態に保つため。

その結果、チーム開発が捗る。

Lintingルールの設定

設定ファイルにルールを記載すると自動的にESLintが認識し、警告してくれる。

設定ファイル: .eslintrc or eslintConfig or package.json

詳しくは、下記のサイトを参考にすると良い。

lintingツール

・JSHint
・JSCS
・ESLint

A Comparison of JavaScript Linting Tools
https://www.sitepoint.com/comparison-javascript-linting-tools/

Setup Linting for Free Code Camp

ローカルインストールとグローバルインストールの2通り。

eslint — npm
https://www.npmjs.com/package/eslint

1: Free Code Campをクローン

2: ターミナルでcdコマンドを使ってFree Code Campディレクトリに移動

3: npm install eslint — save-dev

4: Atomで linter-eslint と linter をインストール

質問事項

特になし

所感

こういうツール基本的に、ローカルインストールとグローバルインストールあるけど、プロジェクトごとにインストールしておかないとバージョン違って動かなくなったりしてその度に厳しさを感じてた記憶。

    Shuma Mizuno

    Written by

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade