JoshuaKGoldberg / JoshuaKGoldberg/TypeStat

🐛 Bug: include glob is broken on windows

Open
#2,351 3 comments 2 reactions 0 assignees View on GitHub
status: accepting prs type: bug
Dominant language
TypeScript
Stars
2.3k
Forks
47
Avg merge
15h 55m
Merged PRs (30d)
21

Description

### Bug Report Checklist

- [x] I have tried restarting my IDE and the issue persists.
- [x] I have pulled the latest `main` branch of the repository.
- [x] I have [searched for related issues](https://github.com/JoshuaKGoldberg/TypeStat/issues?q=is%3Aissue) and found none that matched my issue.

### Expected

Expected it to work.:)

### Actual

`collectFileNamesFromGlobs` [uses](https://github.com/JoshuaKGoldberg/TypeStat/blob/b67d4df9c4fd5f74c43a0ed77857acf92cc0300b/src/collectFileNames.ts#L36) default `node:path` which results in paths like `C:\foo\bar\**\*.js` on windows.
`glob` processes backslashes [as escape characters](https://github.com/isaacs/node-glob/blob/6cb281dc4e072e2c4d656177892284f2e6f930fd/README.md?plain=1#L138) and so returns nothing of use.

You should use something like [upath](https://www.npmjs.com/package/upath) for all paths work, or set `windowsPathsNoEscape: true` in the glob options.

### Additional Info

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.