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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we need to do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the logic in rpts2:
I don't see an issue... it should work fine.
Although strangely enough a different merge loses some options which I'm surprised get lost...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There exists a few lines after L44 in that rpts2 file I linked which I believe also do some merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not because of rpts2 -- that's how
_.merge
works with arrays.exclude
is an array, so your custom exclude would just override the same indices.In your first "test",
**/*.stories.tsx
also overrides the first entry,**/*.spec.ts
I think this jogged my brain a bit -- I'm pretty sure that line in rpts2 is around where the bug is.
TSDX has similar logic as rpts2 using TS's custom parsers to read a
tsconfig
and then get itscompilerOptions
through allextends
chains. But that's only forcompilerOptions
, meaningexclude
etc from anextends
aren't actually parsed.Problem there is that I don't know if there's a way to get the rest. This part of the TS API isn't documented but is used in lots of places in the wild for parsing, it took me a while to figure out how to do it myself, c.f. #489
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, the original config gets mutated with the new
include
/exclude
, whilecompilerOptions
is unchanged and returned per facebook/create-react-app#5537I'll have to look into rpts2 config and see if there's actually a bug or not, I'm not sure. I still haven't repro'd #663