Skip to content

I am unable to disable a custom rule #1340

Answered by wooorm
wdcryer asked this question in Q&A
Discussion options

You must be logged in to vote

Most of those packages are all about messages; they work based on their positional info. And then remove messages.

The comments are in the AST. So you can use mdast-comment-marker to parse their syntax. And then choose to do things in your transform.

Though, why use comments? You can look for an attribute on JSX: <SomeComponent someProp />.

But, personally, I wouldn’t do it: MDX already has ways to differentiate between different things:

{
  <SomeComponent>
    This is just JSX, not *emphasis*, no `p`.
  </SomeComponent>
}

<SomeComponent>
  This is MDX, there is a `p` in the thing, and *emphasis* works.
</SomeComponent>

This is <SomeComponent>MDX,
where an *emphasis* works,
and</SomeCom…

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@wdcryer
Comment options

Comment options

You must be logged in to vote
5 replies
@wdcryer
Comment options

@wooorm
Comment options

@wdcryer
Comment options

@wooorm
Comment options

Answer selected by wdcryer
@wdcryer
Comment options

Comment options

You must be logged in to vote
1 reply
@wdcryer
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants