简体   繁体   中英

How to get .eslintrc.js ignore all none js files

How to configure .eslintr.js to ignore all non-js files?

I started a .eslintignore file with the rule !**/*.js but doesn't work.

You're close. In the .eslintignore section for negating ( ! ) (emphasis mine):

Lines preceded by ! are negated patterns that re-include a pattern that was ignored by an earlier pattern.

So, ignore everything (you can use blob, or a specific directory, etc.) and then un-ignore js files:

src/
!src/**/*.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