fix(files-matcher): build patterns from the normalized file spec - #137
Open
NotAFlightRisk wants to merge 2 commits into
Open
fix(files-matcher): build patterns from the normalized file spec#137NotAFlightRisk wants to merge 2 commits into
NotAFlightRisk wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I had
exclude: ["dist/"]in a tsconfig andcreateFilesMatcherstill returned a config fordist/index.d.ts, wheretsc --listFileson the same project doesnt list it.outDir: "dist/"goes the same way.Its the trailing slash. tsc normalizes a spec into path components before building the pattern so the slash stops existing, and get-tsconfig builds off the raw string instead. Exclude patterns already append
($|/)to prune a directory's subtree, so with the spec's own slash in front of that the pattern ends up wanting two. Goes wrong the other way as well -files: ["index.ts/"]drops a root file tsc does pick up.And there's a second fix here too, because the first one cant go in without it. tsc drops an include ending in
**(src/**is TS5010) while the matcher reads it as everything undersrc. Leave it andsrc/**/goes from matching nothing to matching the lot. Both rules sit within ten lines of the oneisImplicitGlobPatternalready came from.Most of the +155 is tests, the source change is 16 lines. Same on 4.14.3 and 5.0.0-beta.6.