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: Error while loading rule 'no-irregular-whitespace': sourceCode.getAllComments is not a function #272

Closed
1 task
ocavue opened this issue Aug 22, 2024 · 2 comments
Labels
documentation repro:yes Issues with a reproducible example upgrade

Comments

@ocavue
Copy link
Contributor

ocavue commented Aug 22, 2024

Environment

ESLint version: 9.9.0
@eslint/markdown version: 6.0.0
Node version: v18.20.2
npm version: pnpm 8.15.9
Operating System: macOS

Which language are you using?

commonmark

What did you do?

After updating from eslint-plugin-markdown v5 to @eslint/markdown v6, I get the following error:

TypeError: Error while loading rule 'no-irregular-whitespace': sourceCode.getAllComments is not a function

Minimal repo:

What did you expect to happen?

No error.

What actually happened?

TypeError: Error while loading rule 'no-irregular-whitespace': sourceCode.getAllComments is not a function

Link to Minimal Reproducible Example

https://stackblitz.com/github/issueset/eslint-markdown-v6-issue

Participation

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

Additional comments

No response

@ocavue ocavue added bug repro:needed This issue should include a reproducible example labels Aug 22, 2024
@eslintbot eslintbot added this to Triage Aug 22, 2024
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Aug 22, 2024
@fasttime fasttime moved this from Needs Triage to Triaging in Triage Aug 22, 2024
@fasttime
Copy link
Member

Thanks for the report @ocavue, I can reproduce the issue. There have been some breaking changes in v6, but unfortunately, we haven't added migration instructions for this plugin yet. One of the changes is that what was previously the recommended config is now named processor. The config name was changed to make room for a recommended config that includes language capabilities, one of the newest features in ESLint, also to be documented.

To fix your config file use the processor config instead of recommended for @eslint/markdown v6.

Demo: https://stackblitz.com/edit/github-qwd2hs?file=eslint.config.mjs

@fasttime fasttime added upgrade repro:yes Issues with a reproducible example documentation and removed repro:needed This issue should include a reproducible example bug labels Aug 22, 2024
@fasttime fasttime moved this from Triaging to Evaluating in Triage Aug 22, 2024
@ocavue
Copy link
Contributor Author

ocavue commented Aug 22, 2024

@fasttime Thanks! That works.

@nzakas nzakas closed this as not planned Won't fix, can't repro, duplicate, stale Aug 22, 2024
@github-project-automation github-project-automation bot moved this from Evaluating to Complete in Triage Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation repro:yes Issues with a reproducible example upgrade
Projects
Archived in project
Development

No branches or pull requests

3 participants