如何使有关eslint中被忽略文件的警告静音 [英] how to silence warnings about ignored files in eslint

查看:1684
本文介绍了如何使有关eslint中被忽略文件的警告静音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

设置 eslint 并在忽略列表中添加一些文件后,每次运行eslint都会产生有关被忽略的文件的警告:

After setting up eslint and adding some files in the ignore list, every time that eslint is run it produces warnings about files that are ignored:

 /path/to/file/name.min.js
  0:0  warning  File ignored because of a matching ignore pattern. Use "--no-ignore" to override

如何使此警告静音?

推荐答案

我目前知道的一种解决方法是-quiet 选项,该选项可消除所有警告。当然,如果您的配置中有警告规则,这是没有意义的。

One workaround I know at the moment is --quiet option, which suppresses all warnings. Of course that doesn't make sense if you have "warn" rules in your config.

不显示警告的另一种方法是使用目录名: eslint src 而不是遍历模式: eslint src / *

Another way not to show that warning is to use dir names: eslint src instead of globbing patterns: eslint src/*.

这篇关于如何使有关eslint中被忽略文件的警告静音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆