{"id":27342,"library":"remark-lint-no-shortcut-reference-image","title":"remark-lint-no-shortcut-reference-image","description":"remark-lint rule to warn when shortcut reference images are used in Markdown. Shortcut references like ![text] look similar to plain text and can cause ambiguity; this rule enforces the use of collapsed or full reference images ([text][] or [text][reference]) to improve clarity. Current version is 4.0.1, part of the remark-lint monorepo. Releases follow semver; breaking changes may occur with major version bumps. This package is ESM-only, ships TypeScript types, and is recommended for consistent reference image syntax.","status":"active","version":"4.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/remarkjs/remark-lint#main","tags":["javascript","image","lint","reference","remark","remark-lint","remark-lint-rule","rule","shortcut","typescript"],"install":[{"cmd":"npm install remark-lint-no-shortcut-reference-image","lang":"bash","label":"npm"},{"cmd":"yarn add remark-lint-no-shortcut-reference-image","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-lint-no-shortcut-reference-image","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for integration with remark-lint","package":"unified","optional":false},{"reason":"Required plugin registry for lint rules","package":"remark-lint","optional":false},{"reason":"Used for message control in some setups","package":"remark-message-control","optional":true}],"imports":[{"note":"Default export; named exports are not available as of v4.","wrong":"import { remarkLintNoShortcutReferenceImage } from 'remark-lint-no-shortcut-reference-image'","symbol":"remarkLintNoShortcutReferenceImage","correct":"import remarkLintNoShortcutReferenceImage from 'remark-lint-no-shortcut-reference-image'"},{"note":"CommonJS require works in Node.js, but package is ESM-first. Use dynamic import or ESM for compatibility.","wrong":"","symbol":"require","correct":"const remarkLintNoShortcutReferenceImage = require('remark-lint-no-shortcut-reference-image')"},{"note":"Types are bundled but no Options type exists because the rule has no options. Import the default export to get types.","wrong":"import type { Options } from 'remark-lint-no-shortcut-reference-image'","symbol":"TypeScript types","correct":"import remarkLintNoShortcutReferenceImage from 'remark-lint-no-shortcut-reference-image'"}],"quickstart":{"code":"import { unified } from 'unified';\nimport remarkParse from 'remark-parse';\nimport remarkStringify from 'remark-stringify';\nimport remarkLint from 'remark-lint';\nimport remarkLintNoShortcutReferenceImage from 'remark-lint-no-shortcut-reference-image';\nimport { reporter } from 'vfile-reporter';\n\nconst file = await unified()\n  .use(remarkParse)\n  .use(remarkLint)\n  .use(remarkLintNoShortcutReferenceImage)\n  .use(remarkStringify)\n  .process('![bad reference]\\n\\n[bad reference]: https://example.com/image.png');\n\nconsole.log(reporter(file));\n// Output: 1:1-1:16: Unexpected shortcut reference image (`![text]`), expected collapsed reference (`![text][]`)","lang":"typescript","description":"Lint a Markdown string for shortcut reference images using the unified ecosystem. The rule warns, does not modify."},"warnings":[{"fix":"Switch to ESM (import/export) or use dynamic import: const module = await import('remark-lint-no-shortcut-reference-image');","message":"The package is ESM-only since version 4.0.0. You cannot use require() in CommonJS without dynamic import.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Use default import: import remarkLintNoShortcutReferenceImage from 'remark-lint-no-shortcut-reference-image';","message":"Export changed from named export to default export in version 4.0.0. Importing { remarkLintNoShortcutReferenceImage } will break.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Do not pass options; simply use .use(remarkLintNoShortcutReferenceImage).","message":"The rule has no configuration options. Providing an options object will be silently ignored but may cause confusion.","severity":"gotcha","affected_versions":"*"},{"fix":"Follow recommendations to use collapsed or full references.","message":"Shortcut reference images are discouraged for accessibility reasons. This rule may be merged into a more general rule in the future.","severity":"deprecated","affected_versions":">=3.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use import or dynamic import: const remarkLintNoShortcutReferenceImage = (await import('remark-lint-no-shortcut-reference-image')).default;","cause":"Using require() with an ESM-only package in a CommonJS context.","error":"ERR_REQUIRE_ESM: require() of ES Module"},{"fix":"Use the package as a unified plugin: .use(remarkLintNoShortcutReferenceImage).","cause":"Attempting to use the package as an object or calling it directly without the unified pipeline.","error":"TypeError: remarkLintNoShortcutReferenceImage is not a function"},{"fix":"Run npm install remark-lint-no-shortcut-reference-image.","cause":"Package not installed or missing in package.json.","error":"Cannot find module 'remark-lint-no-shortcut-reference-image'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}