{"id":26199,"library":"remark-lint-correct-media-syntax","title":"remark-lint-correct-media-syntax","description":"A remark-lint rule that warns when image or link syntax has brackets and parentheses accidentally swapped (e.g., `(text)[url]` instead of `[text](url)`). Current stable version is 1.0.1, ESM-only, requires Node.js 16+. It is a focused, zero-config lint rule with no parameters, part of the unified/remark ecosystem. Unlike broader lint presets, this rule targets a single common mistake with a clear, actionable message.","status":"active","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/remarkjs/remark-lint#main","tags":["javascript","bracket","image","link","lint","media","parenthesis","reference","remark","typescript"],"install":[{"cmd":"npm install remark-lint-correct-media-syntax","lang":"bash","label":"npm"},{"cmd":"yarn add remark-lint-correct-media-syntax","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-lint-correct-media-syntax","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core unified library required for processing","package":"unified","optional":false},{"reason":"Required to use remark-lint plugins","package":"remark-lint","optional":false},{"reason":"Parser needed to process markdown","package":"remark-parse","optional":true},{"reason":"Serializer needed for output","package":"remark-stringify","optional":true}],"imports":[{"note":"This package is ESM-only and requires Node.js 16+. Using require() will throw an error.","wrong":"const remarkLintCorrectMediaSyntax = require('remark-lint-correct-media-syntax')","symbol":"remarkLintCorrectMediaSyntax","correct":"import remarkLintCorrectMediaSyntax from 'remark-lint-correct-media-syntax'"},{"note":"The package exports no named identifiers; the default export is the function.","wrong":"import { remarkLintCorrectMediaSyntax } from 'remark-lint-correct-media-syntax'","symbol":"default export","correct":"import remarkLintCorrectMediaSyntax from 'remark-lint-correct-media-syntax'"},{"note":"The package does not export custom types; you can use Transformer from unified if needed.","wrong":null,"symbol":"TypeScript types","correct":"import type { Transformer } from 'unified'"}],"quickstart":{"code":"import { unified } from 'unified';\nimport remarkParse from 'remark-parse';\nimport remarkStringify from 'remark-stringify';\nimport remarkLint from 'remark-lint';\nimport remarkLintCorrectMediaSyntax from 'remark-lint-correct-media-syntax';\nimport { reporter } from 'vfile-reporter';\n\nconst file = await unified()\n  .use(remarkParse)\n  .use(remarkLint)\n  .use(remarkLintCorrectMediaSyntax)\n  .use(remarkStringify)\n  .process('(wrong)[https://example.com] and [correct](https://example.com)');\n\nconsole.error(reporter(file));","lang":"typescript","description":"Shows how to use the plugin with unified to lint markdown for swapped bracket/paren syntax."},"warnings":[{"fix":"Use import syntax instead of require(). Switch to ESM or use dynamic import() if needed.","message":"Package is ESM-only and does not support CommonJS require().","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"No workaround; if you need to customize behavior, consider other lint rules or use remark-message-control.","message":"The rule has no configuration options; it always checks for the specific pattern.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use additional remark-lint plugins (e.g., remark-lint-no-literal-urls) for broader coverage.","message":"The rule does not check for other media syntax issues like missing alt text or broken URLs.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Upgrade Node.js to version 16 or later.","message":"Node.js 16 is the minimum required version; Node 14 is not supported.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Change to import statement or use dynamic import().","cause":"Using CommonJS require() to load the ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module"},{"fix":"Swap the brackets and parentheses to `[text](url)`.","cause":"Using `(text)[url]` instead of `[text](url)`.","error":"Unexpected `)[`, expected `[` and `]` around the text (label) and `(` and `)` around the URL"},{"fix":"Run `npm install remark-lint-correct-media-syntax` and verify the import path.","cause":"The package is not installed or the import path is incorrect.","error":"Cannot find module 'remark-lint-correct-media-syntax'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}