简体   繁体   中英

Eslint ignore all exept js fles

How can I ignore all files in the directory scr/ except the .js files? (using a .eslintignore file)

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. Something like eslint scr/**/*.js

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM