feat: allow specifying imports to be ignored during the DTS file generation #412
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.
Description
This PR adds the feature to specify imports to be ignored during DTS file generation via the
ignoreDts
option. This feature solves a problem I'm having in production (#408) by enabling some imports to be auto-imported while preventing them to be put in the generated DTS file. This way I can declare them myself as needed without running on conflincts.It also solves a little bug I found. Despite
ignore
(and nowignoreDts
) being declared as(string|RegExp)[]|undefined
in theOptions
they were being compared using a strict equal only, so regexes would always fail. I solved this by creating a small helper function. If it was the expected behavior in the first place please let me know.The API is as following: