Closed roger-schaer closed 3 months ago
Latest commit: ca37142ee0d880b2c9bd34fcbab7a2c7b7b5794f
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Hi @quantizor, just wanted to check if you would have time in the coming weeks to check out this PR, it would unblock some things on my end if this could be merged. Thanks in advance and have a nice summer!
Hi @quantizor, just wanted to check if you would have time in the coming weeks to check out this PR, it would unblock some things on my end if this could be merged. Thanks in advance and have a nice summer!
Hey Roger! I will try to make time, thanks for the reminder. Lots going on personally at the moment.
Hi @quantizor, just wanted to check if you would have time in the coming weeks to check out this PR, it would unblock some things on my end if this could be merged. Thanks in advance and have a nice summer!
Hey Roger! I will try to make time, thanks for the reminder. Lots going on personally at the moment.
No worries, thank you for your answer and your help!
@quantizor hello, any plans in merging this? thanks
Thanks a lot @quantizor, I tested it now and it works perfectly with the new version!
Summary
This PR resolves https://github.com/quantizor/markdown-to-jsx/issues/539 by replacing the
RuleType
enum with a const object.Description
As mentioned & discussed in https://github.com/quantizor/markdown-to-jsx/issues/539, the current way of declaring the
RuleType
as anenum
causes problems when using isolatedModules intsconfig.json
.The solution, as described on the TypeScript website, is to simply replace the
enum
with a simple objectconst
, and declare atype
based on its keys & values. Additional updates were needed to correctly use types (and not values) in the various interfaces defined for node types.This worked correctly, but there were still issues when running tests using Jest with the modifications made in
index.tsx
. Therefore, an additional change was made inindex.cjs.tsx
in order to export theRuleType
explicitly (as is done with thecompiler
function).Testing
Since the updated code is functionally equivalent to the existing version & all existing unit tests pass correctly, it was not clear what type of test could be added.