standard / ts-standard

Typescript style guide, linter, and formatter using StandardJS
https://www.npmjs.com/package/ts-standard
MIT License
464 stars 36 forks source link

project package option does not support glob patterns #216

Closed starpit closed 1 year ago

starpit commented 2 years ago

What version of this package are you using? 11.0.0

What operating system, Node.js, and npm version?

What happened?

The docs state:

Its possible to specify multiple projects using an array as in the underlying parser

The referenced underlying specification for this field states that one may

add each referenced tsconfig to the project field either separately, or via a glob.

However, ts-standard, in its validator isValidPath, assumes that an array of projects specifies concrete filepaths, not glob patterns (because it calls fs.statSync on each of the given array entries).

What did you expect to happen?

Support for glob patterns, so we don't have to hard-code all of our sub-projects in our package.json

Are you willing to submit a pull request to fix this bug?

I guess so. It seems like a straightforward fix. To be honest, I don't know why ts-standard is going through the trouble of validating these filepaths, since the underlying logic probably will, on its own?