markdown/no-reversed-media-syntax
Disallow reversed link and image syntax
fixable
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#
example.md2 problems
Read (the guide)[https://example.com/guide]Unexpected reversed syntax found. Use [label](URL) syntax instead..
!(The logo)[./logo.png]Unexpected reversed syntax found. Use [label](URL) syntax instead.example.mdNo problems
Read [the guide](https://example.com/guide).

Call `f(a)[0]`.