Linter · Rules
markdown/no-reversed-media-syntax
Disallow reversed link and image syntax
The syntax is [text](url). The other way around, (text)[url], isn't a link, and all of it shows up as text.
--fix swaps the brackets.
Configure
Off by default. It needs an ESLint config that says which files are in the language:
eslint.config.js
import markdown from "@eslint/markdown";
export default [
{
files: ["**/*.md"],
plugins: { markdown },
language: "markdown/commonmark",
rules: { "markdown/no-reversed-media-syntax": "error" },
},
];
It also works with markdown/gfm.
Examples
Reported:
Read (the guide)[https://example.com/guide].
!(The logo)[./logo.png]
Not reported:
Read [the guide](https://example.com/guide).

Call `f(a)[0]`.