You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a Markdown file with the following content:
[Foo][foo][Bar][]
Enable the @eslint/markdown plugin and the markdown/no-missing-label-refs rule in your ESLint configuration.
Run ESLint on the Markdown file.
What did you expect to happen?
1:7 error Label reference 'foo' not found markdown/no-missing-label-refs
2:2 error Label reference 'Bar' not found markdown/no-missing-label-refs
What actually happened?
ESLint throws the following exception and stops execution:
Oops! Something went wrong! :(
ESLint: 9.12.0
TypeError: Cannot read properties of undefined (reading 'length')
Occurred while linting ...\eslint-markdown-sample\docs\sample.md:1
Rule: "markdown/no-missing-label-refs"
at findMissingReferences (.../eslint-markdown-sample/node_modules/@eslint/markdown/dist/esm/index.js:1509:25)
at text (.../eslint-markdown-sample/node_modules/@eslint/markdown/dist/esm/index.js:1580:9)
at ruleErrorHandler (...\eslint-markdown-sample\node_modules\eslint\lib\linter\linter.js:1084:48)
at ...\eslint-markdown-sample\node_modules\eslint\lib\linter\safe-emitter.js:45:58
at Array.forEach (<anonymous>)
at Object.emit (...\eslint-markdown-sample\node_modules\eslint\lib\linter\safe-emitter.js:45:38)
at NodeEventGenerator.applySelector (...\eslint-markdown-sample\node_modules\eslint\lib\linter\node-event-generator.js:297:26)
at NodeEventGenerator.applySelectors (...\eslint-markdown-sample\node_modules\eslint\lib\linter\node-event-generator.js:326:22)
at NodeEventGenerator.enterNode (...\eslint-markdown-sample\node_modules\eslint\lib\linter\node-event-generator.js:337:14)
at runRules (...\eslint-markdown-sample\node_modules\eslint\lib\linter\linter.js:1128:40)
Environment
ESLint version: 9.12.0
@eslint/markdown version: 9.12.0
Node version: 20.9.0
npm version: 10.8.3
Operating System: Windows 11
Which language are you using?
commonmark
What did you do?
Configuration
@eslint/markdown
plugin and themarkdown/no-missing-label-refs
rule in your ESLint configuration.What did you expect to happen?
What actually happened?
ESLint throws the following exception and stops execution:
Link to Minimal Reproducible Example
https://stackblitz.com/edit/stackblitz-starters-bhmkmm?file=package.json
Participation
Additional comments
Failing Test Case
The following test case results in the exception being thrown:
Other Cases Where the Error Occurs
Cases Where No Error Occurs
The text was updated successfully, but these errors were encountered: