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

no-unused-disable does not work within Markdown files #23

Closed
ehmicky opened this issue Apr 28, 2019 · 2 comments
Closed

no-unused-disable does not work within Markdown files #23

ehmicky opened this issue Apr 28, 2019 · 2 comments

Comments

@ehmicky
Copy link

ehmicky commented Apr 28, 2019

README.md:

<!-- eslint-disable no-inline-comments -->

```js
var aa = true
```

.eslintrc.yml:

plugins:
  - eslint-comments
  - markdown
rules:
  no-inline-comments: 2
  eslint-comments/no-unused-disable: 2

In the terminal:

$ eslint README.md

The command does not report any errors. However no-unused-disable should be reported.

Versions:

  • eslint: 5.16.0 (also fails with 6.0.0-alpha.0)
  • eslint-plugin-eslint-comments: 3.1.1
  • eslint-plugin-markdown: 1.0.0

I am not sure whether the issue comes from eslint-plugin-eslint-comments or eslint-plugin-markdown, so I decided to report this bug here.

@mysticatea
Copy link
Owner

Thank you for this report.

eslint-comments/no-unused-disable is the alias of --report-unused-disable-directives option.

The markdown plugin seems to handle the HTML comments in a different way from ESLint core, so the rule doesn't recognize the HTML comments. So this is not a bug, but an enhancement.

@ehmicky
Copy link
Author

ehmicky commented Apr 30, 2019

Thanks for your answer, you're right. Now I know eslint-plugin-markdown is the problem, not eslint-plugin-eslint-comments. I've added an issue to their repository.

@ehmicky ehmicky closed this as completed Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants