0
0

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 3 years have passed since last update.

Node.jsのLinter, Formatter比較 2021

Posted at

#はじめに
Node.jsでアプリ開発をするにあたり、2021年現在で使用するのが良さそうなLinter, Formatterについて調査しました。
2021/5/29時点での情報です。

Linter, Formatter比較表

調査したLinter, Formatterは以下の4つです。
概要については、こちらの記事を参考にさせていただきました。
推奨は、調査結果から使うのが良さそうかどうか私が判断した項目です。

項目名 概要 npmダウンロード数 推奨 URL
ESLint ・現在最も使用されている
・すべてのルールについて適用するかどうかを決められる
・自分のプロジェクトに合わせたルールを作れる
14,979,235 https://eslint.org/
JSLint ・ESLint普及前に使われていた
・コーディング制約が厳しすぎた
20,003 × https://www.jslint.com/
JSHint ・JSLintをフォークして作られた
・デフォルトのコーディング制約が緩くなり、設定ファイルベースでコーディング制約の調整が可能となった
405,339 × https://jshint.com/
prettier ・コードフォーマッターに特化している
・ESLintなどと機能がかぶるが、より可読性の高いコード整形を行える
12,123,554 https://prettier.io/

Linter, Formatterダウンロード数比較グラフ

参考サイト
https://www.npmtrends.com/eslint-vs-jshint-vs-jslint-vs-prettier

linter_npmtrends.png

結論

ESLintとprettierを、必要に応じて併用するなどして使うのが良さそうです。

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?