# markdown/no-invalid-label-refs

> Disallow invalid label references

`[guide][]` is short for `[guide][guide]`. With whitespace between the last two brackets, it's no longer a reference, and the brackets show up in the text.

{/* Generated by src/codegen/lint-rule-docs.ts. Do not edit this section. */}

## Configure

Off by default. It needs an ESLint config that says which files are in the language:

{/* skip */}

```js eslint.config.js
import markdown from "@eslint/markdown";

export default [
  {
    files: ["**/*.md"],
    plugins: { markdown },
    language: "markdown/commonmark",
    rules: { "markdown/no-invalid-label-refs": "error" },
  },
];
```

It also works with `markdown/gfm`.

{/* End of the generated section. */}

## Examples

Reported:

{/* bad */}

```md
Read the [guide][ ].

[guide]: https://example.com/guide
```

Not reported:

{/* good */}

```md
Read the [guide][], the [guide], or [this][guide].

[guide]: https://example.com/guide
```
