mysticatea / eslint-plugin-eslint-comments

Additional ESLint rules for directive comments of ESLint.
https://mysticatea.github.io/eslint-plugin-eslint-comments/
MIT License
354 stars 44 forks source link

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

Closed ehmicky closed 5 years ago

ehmicky commented 5 years ago

README.md:

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

```js
var aa = true

`.eslintrc.yml`:

```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:

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 commented 5 years ago

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 commented 5 years ago

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.