eslint / markdown

Lint JavaScript code blocks in Markdown documents
MIT License
406 stars 63 forks source link

Bug: If `processor` detection block is used it will cause `markdown` rule to not work. #276

Closed m1rn closed 2 months ago

m1rn commented 2 months ago

Environment

ESLint version: 9.9.1 @eslint/markdown version: 6.0.0 Node version: 22.1.0 npm version: 10.7.0 Operating System: Windows

Which language are you using?

commonmark

What did you do?

Configuration ```js import markdown from '@eslint/markdown'; export default [ { files: ['**/*.js'], rules: { 'no-console': 2, }, }, { files: ['**/*.md'], plugins: { markdown, }, language: 'markdown/commonmark', processor: 'markdown/markdown', rules: { 'markdown/fenced-code-language': 2, 'markdown/heading-increment': 2, 'markdown/no-empty-links': 2, 'markdown/no-invalid-label-refs': 2, 'markdown/no-missing-label-refs': 2, }, }, { files: ['**/*.md/**/*.js'], rules: { 'no-console': 2, }, }, ]; ```
# H1

#### Expected to be wrong, but passed

```js
const message = 'Hello, world!'
console.log(message)

What did you expect to happen?

markdown/heading-increment should throw an error, but it passes if a processor is provided.

What actually happened?

-

Link to Minimal Reproducible Example

https://stackblitz.com/edit/stackblitz-starters-hu6gry?file=package.json

Participation

Additional comments

No response

nzakas commented 2 months ago

This is a limitation of ESLint -- you can't use processor together with rules right now.