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

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

Closed
1 task
m1rn opened this issue Aug 30, 2024 · 1 comment
Closed
1 task
Labels
bug repro:needed This issue should include a reproducible example

Comments

@m1rn
Copy link

m1rn commented Aug 30, 2024

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

  • I am willing to submit a pull request for this issue.

Additional comments

No response

@m1rn m1rn added bug repro:needed This issue should include a reproducible example labels Aug 30, 2024
@nzakas
Copy link
Member

nzakas commented Aug 30, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug repro:needed This issue should include a reproducible example
Projects
Archived in project
Development

No branches or pull requests

2 participants