LoginSignup
64
36

More than 5 years have passed since last update.

eslintで任意のディレクトリ、ファイルをチェック対象から除外する方法

Last updated at Posted at 2016-07-04

JSのeslintで一部のファイルのみバリデートから除外したい場合は、.eslintignoreファイルを用意し、そこに任意のディレクトリないしファイル名を書けば対象外にしてくれるっぽい。
Gitでいう.gitignoreとほぼ同じ。

どんなとき役に立つか

外部ライブラリ、他人が書いた手がつけられないファイル を含むとき。
ここまでlintのチェックが入るとエラーだらけになってしまうので、.eslintignoreは積極的に使っていこう。

src/lib/*
**/*.js
foo.js

備考

  • .eslintと同じ階層に置いたほうがいいっぽい
  • その他何か設定する必要はなく、.eslintignoreを置いておけばlint時に勝手に動いてくれるっぽい。

参考URL

↑”Ignoring Files and Directories”の部分

64
36
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
64
36