Registry / testing / remark-lint-no-shortcut-reference-link

remark-lint-no-shortcut-reference-link

JSON →
library4.0.1jsnpmunverified

A remark-lint rule that warns when shortcut reference links (`[text]` without explicit brackets for the label) are used in Markdown. Version 4.0.1 is the latest stable release, part of the remark-lint monorepo. It enforces consistency by recommending collapsed or full reference links instead. This rule is included in recommended and markdown style guide presets. Rules are updated regularly; check the main remark-lint releases.

npm install remark-lint-no-shortcut-reference-link
INSTALL
IMPORT
SIG · REMARK-LINT-NO-SHO
R
remark-lint-no-shortcut-reference-link
testingjavascriptv4.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

remarkLintNoShortcutReferenceLink
✓ import remarkLintNoShortcutReferenceLink from 'remark-lint-no-shortcut-reference-link'
✗ const remarkLintNoShortcutReferenceLink = require('remark-lint-no-shortcut-reference-link')
Package is ESM-only since v4; no CJS support. In Node.js 16+, use import.
No default export; use default export
✓ import remarkLintNoShortcutReferenceLink from 'remark-lint-no-shortcut-reference-link'
✗ import { remarkLintNoShortcutReferenceLink } from 'remark-lint-no-shortcut-reference-link'
The package exports a single default function, not a named export.
TypeScript types
✓ import type { Plugin } from 'unified'; import remarkLintNoShortcutReferenceLink from 'remark-lint-no-shortcut-reference-link'
Types are included; no separate @types package needed.

Lints Markdown with the shortcut-reference-link rule using unified pipeline.

import remarkLint from 'remark-lint' import remarkLintNoShortcutReferenceLink from 'remark-lint-no-shortcut-reference-link' import remarkParse from 'remark-parse' import remarkStringify from 'remark-stringify' import {unified} from 'unified' import {reporter} from 'vfile-reporter' const file = await unified() .use(remarkParse) .use(remarkLint) .use(remarkLintNoShortcutReferenceLink) .use(remarkStringify) .process('[Mercury]\n\n[mercury]: https://example.com/mercury/') console.error(reporter(file))
Debug
Known issues
breakingPackage is ESM-only from v4.0.0. CommonJS require() will fail.
fix
Use import syntax or upgrade Node.js to 16+ and set type:"module" in package.json.
affects: >=4.0.0
breakingMinimum Node.js version is 16, older versions are not supported.
fix
Upgrade to Node.js 16 or later.
affects: >=4.0.0
gotchaThis rule does not accept any options. Passing options silently ignored.
fix
Remove any options object: .use(remarkLintNoShortcutReferenceLink) with no arguments.
affects: all
gotchaRule only works with remark-lint plugin; using it directly without remark-lint has no effect.
fix
Ensure remark-lint is also used: .use(remarkLint).use(remarkLintNoShortcutReferenceLink).
affects: all
deprecatedNo deprecations known in current version.
affects: none
Errors
Common errors & fixes
Cannot find module 'remark-lint-no-shortcut-reference-link'
Package not installed or ESM-only import used in CJS context.
fix
Install: npm install remark-lint-no-shortcut-reference-link. If using require, switch to import or use dynamic import().
SyntaxError: Unexpected identifier 'remarkLintNoShortcutReferenceLink'
Using import statement in a non-ESM file (no type:module or .mjs extension).
fix
Set type: "module" in package.json or rename file to .mjs.
TypeError: remarkLintNoShortcutReferenceLink is not a function
Trying to use the rule without unified, or passing options incorrectly.
fix
Use .use(remarkLintNoShortcutReferenceLink) without arguments (rule accepts no options).
No warnings emitted even for shortcut reference links
Missing remark-lint plugin itself; rules are inactive without it.
fix
Add .use(remarkLint) before the rule.
Upgrade
Version history
4.0.1latest on npm
Audit
Dependencies
unifiedrequiredPeer dependency; remark-lint rules are unified plugins.
remark-lintrequiredRequired to use remark-lint rules; this package is a rule for remark-lint.
remark-parseoptionalNeeded to parse Markdown; typically used in the pipeline.
remark-stringifyoptionalNeeded to stringify Markdown; typically used in the pipeline.
Agent activity
4 hits · last 30 days
node
4
Resources
remark-lint-no-shortcut-reference-link — npm install remark-lint-no-shortcut-reference-link · libregistry