-
Notifications
You must be signed in to change notification settings - Fork 63
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
feat: Add disable comment support #281
Conversation
Ping @eslint/eslint-team |
We don't want to implement this or we'll implement it in another PR? |
We can implement it in a separate PR. Just wanted to keep this PR focused on the disable directives. |
src/language/markdown-source-code.js
Outdated
end.column = | ||
commentLineCount === 0 | ||
? start.column + comment.length | ||
: comment.length - comment.lastIndexOf("\n") - 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
: comment.length - comment.lastIndexOf("\n") - 1; | |
: comment.length - comment.lastIndexOf("\n"); |
As the columns are 1-based in this language.
Co-authored-by: Milos Djermanovic <[email protected]>
Co-authored-by: Milos Djermanovic <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Leaving open for @aladdin-add to verify.
Ping @aladdin-add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!👍
This PR adds support for disable comments to the Markdown plugin. It supports all of the variations that ESLint supports:
eslint-disable
/eslint-enable
eslint-disable-line
eslint-disable-next-line
While working on this, I discovered a bug in
no-html
where it was only reporting the first HTML tag in anhtml
node even though there can be multiple. It was also skipping anyhtml
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 */
.