[英]Eslint ignore all exept js fles
How can I ignore all files in the directory scr/
except the .js
files?如何忽略目录
scr/
中除.js
文件之外的所有文件? (using a .eslintignore
file) (使用
.eslintignore
文件)
I tried using我尝试使用
scr/*
!scr/*.js
A single star *
only matches filenames, if you have directories you'll need to be using **
as part of the match:单个星
*
仅匹配文件名,如果您有目录,则需要使用**
作为匹配的一部分:
# Exclude **/scr/
scr/
# ...but not **/scr/**/*.js
!scr/**/*.js
In this case it might be easier to target javascript files instead of trying to ignore all other files.在这种情况下,以 javascript 文件为目标可能比尝试忽略所有其他文件更容易。 Something like
eslint scr/**/*.js
像
eslint scr/**/*.js
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.