2

I'm trying to write a glob to match .css or .scss files but ignore vendor and ignore node_modules at any nesting depth.

vendor/please-ignore.css
vendor/example/please-ignore.css
node_modules/any/please-ignore.css
other/please-match.css
other/example/please-match.css
other/node_modules/please-ignore.css
other/example/node_modules/please-ignore.css
another/please-match.css
another/example/please-match.css
another/node_modules/please-ignore.css
another/example/node_modules/please-ignore.css

I feel like I'm close. This successfully ignores top-level vendor and node_modules but still matches nested node_modules:

stylelint './!(vendor|node_modules)/**/*.?(s)css'

How can I adjust to blacklist node_modules at any level?

ryanve
  • 50,076
  • 30
  • 102
  • 137

1 Answers1

2

Try stylelint '**/!(vendor|node_modules)/*.?(s)css'

This should ignore vendor and node_modules at any nesting depth, including the top level.

jeddy3
  • 3,451
  • 1
  • 12
  • 21