Andre GolFe
Andre GolFe

Reputation: 318

Getting used to regular expressions in TS

I would like to lint staged files that are both .ts or .tsx that are inside the src folder, I know that in order to select all js files you can do "*.js": [--list of commands--] inisde the lint staged property.

I would like to know more about this language used select and import files in node.js, is it similar to regex without escape characters or is it Unix based?

Upvotes: 1

Views: 971

Answers (1)

Alex Wayne
Alex Wayne

Reputation: 187272

Those are GLOB patterns

Most of the time you'll see simple wildcard patterns like:

*.ts

Matches:

foo.ts
bar.baz.ts

Or you'll need to match all files in a directory no matter how deeply nested:

src/**/*.ts

Matches:

src/foo.ts
src/bar/baz.ts
src/a/b/c/d/e/f/g/h/i.ts

Upvotes: 2

Related Questions