Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow comments to contain -- #348

Merged
merged 2 commits into from
Sep 15, 2021
Merged

fix: allow comments to contain -- #348

merged 2 commits into from
Sep 15, 2021

Conversation

jablko
Copy link
Contributor

@jablko jablko commented Sep 10, 2021

This change allows comments to contain --, which currently they can't, e.g.

<!-- eslint-disable-next-line no-console -- Here's a description about why this configuration is necessary. -->
  1:1  error  Block is redundant  no-lone-blocks

I suspect this is already fixed in #284, by upgrading to micromark. This PR adds a test and patches the comment regexp in the meantime.

remark-parse (where this regexp originally came from) went directly from our current regexp to micromark, which doesn't use an equivalent.

I used the following to automatically construct this corrected, "strings that don't contain -->" regexp, substituting aab for --> because it only allows alphanumerics, etc.: http://www.formauri.es/personal/pgimeno/misc/non-match-regex/?word=aab

@codesandbox-ci
Copy link

codesandbox-ci bot commented Sep 10, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@codecov-commenter
Copy link

codecov-commenter commented Sep 11, 2021

Codecov Report

Merging #348 (bdf53c1) into master (29ba0c5) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #348   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines          507       507           
  Branches       109       109           
=========================================
  Hits           507       507           
Impacted Files Coverage Δ
packages/eslint-mdx/src/regexp.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2a5792f...bdf53c1. Read the comment docs.

Copy link
Member

@JounQin JounQin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, it's cool, thank you!

test/fixtures/comments.mdx Show resolved Hide resolved
Copy link
Member

@ChristianMurphy ChristianMurphy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@JounQin JounQin changed the title fix: allow comments to contain -- fix: allow comments to contain -- Sep 15, 2021
@JounQin JounQin merged commit 65028b9 into mdx-js:master Sep 15, 2021
@JounQin
Copy link
Member

JounQin commented Sep 15, 2021

cc @wooorm

@wooorm
Copy link
Member

wooorm commented Sep 15, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants