Bug: False positive markdown/no-missing-label-refs
on GFM Alerts #294
Open
Description
Environment
ESLint version: 9.12.0
@eslint/markdown version: 6.2.1
Node version: 22.9.0
npm version: 10.8.3
Operating System: macOS 14.7
Which language are you using?
gfm
What did you do?
Configuration
import pluginMd from "@eslint/markdown"
export default [
// Silly type narrowing for spreading in full-fledged typechecked `eslint.config.js`
...[pluginMd.configs?.recommended].filter(Boolean).flat(),
{
files: ["**/*.md"],
language: "markdown/gfm",
},
]
> [!NOTE]
> Useful information that users should know, even when skimming content.
> [!TIP]
> Helpful advice for doing things better or more easily.
> [!IMPORTANT]
> Key information users need to know to achieve their goal.
> [!WARNING]
> Urgent info that needs immediate user attention to avoid problems.
> [!CAUTION]
> Advises about risks or negative outcomes of certain actions.
Which is being rendered on GH as:
Note
Useful information that users should know, even when skimming content.
Tip
Helpful advice for doing things better or more easily.
Important
Key information users need to know to achieve their goal.
Warning
Urgent info that needs immediate user attention to avoid problems.
Caution
Advises about risks or negative outcomes of certain actions.
What did you expect to happen?
No violations.
What actually happened?
1:4 error Label reference '!NOTE' not found markdown/no-missing-label-refs
4:4 error Label reference '!TIP' not found markdown/no-missing-label-refs
7:4 error Label reference '!IMPORTANT' not found markdown/no-missing-label-refs
10:4 error Label reference '!WARNING' not found markdown/no-missing-label-refs
13:4 error Label reference '!CAUTION' not found markdown/no-missing-label-refs
Link to Minimal Reproducible Example
https://stackblitz.com/edit/118f65b5-5b7b-4190-9fbe-b023b0542a4e?file=package.json
Participation
- I am willing to submit a pull request for this issue.
Additional comments
More info on GFM Alerts:
- https://github.com/orgs/community/discussions/16925
- https://github.blog/changelog/2023-12-14-new-markdown-extension-alerts-provide-distinctive-styling-for-significant-content/
- https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts
Metadata
Assignees
Type
Projects
Status
Blocked