Skip to content

eslint --report-unused-disable-directives does not work with this plugin #115

Open
@ehmicky

Description

@ehmicky

eslint --report-unused-disable-directives is not reported when a <-- eslint-disable --> is defined in Markdown but is unused (i.e. could be removed).

.eslintrc.yml:

plugins: [markdown]
rules:
  no-inline-comments: 2

README.md:

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

```js
var aa = true
```

index.js:

/* eslint-disable no-inline-comments */
var aa = true

package.json:

{
  "name": "eslint-comments-bug",
  "version": "1.0.0",
  "license": "ISC",
  "dependencies": {
    "eslint": "^5.16.0",
    "eslint-plugin-markdown": "^1.0.0"
  }
}

In the terminal:

$ eslint --report-unused-disable-directives README.md
$ eslint --report-unused-disable-directives index.js

/home/ehmicky/eslint-comments-bug/index.js
  1:1  error  Unused eslint-disable directive (no problems were reported from 'no-inline-comments')

✖ 1 problem (1 error, 0 warnings)

--report-unused-disable-directives works for the JavaScript file, but not for the Markdown (where nothing is reported).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status

      Ready to Implement

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions