# markdown/no-reference-like-urls

> Disallow URLs that match defined reference identifiers

`[the guide](guide)` links to a file called `guide`. If the document also defines `[guide]: ..`, the author almost certainly meant `[the guide][guide]`, with square brackets.

`--fix` changes the parentheses to brackets, unless the link has a title, which a reference can't have.

{/* 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-reference-like-urls": "error" },
  },
];
```

It also works with `markdown/gfm`.

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

## Examples

Reported:

{/* bad {"count": 2} */}

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

![The logo](logo)

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

Not reported:

{/* good */}

```md
Read [the guide][guide] or [the other guide](./guide.md).

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