eslint / markdown

Lint JavaScript code blocks in Markdown documents
MIT License
391 stars 60 forks source link

feat: Add disable comment support #281

Open nzakas opened 1 week ago

nzakas commented 1 week ago

This PR adds support for disable comments to the Markdown plugin. It supports all of the variations that ESLint supports:

While working on this, I discovered a bug in no-html where it was only reporting the first HTML tag in an html node even though there can be multiple. It was also skipping any html node that began with a comment. I also fixed these bugs in this PR, as I needed a good example to test the disable directives.

Note: This PR intentionally does not implement inline configuration comments like /* eslint rule:error */.