lundi 7 octobre 2019

What's a glob pattern to select files with this same extension from multiple subdirectories?

I'm setting up a linter for my JS app, and I'd like to select all *.js, *.jsx, *.ts and *.tsx files from only src, and test subdirectories in my project. A pattern for only one directory works as expected:

./src/**/*.[jt]s?(x)

Is it possible to add an alternative into the /src part? I'm looking for something along the lines of

./(src|test)/**/*.[jt]s?(x)

Aucun commentaire:

Enregistrer un commentaire