Registry / testing / remark-lint-no-undefined-references

remark-lint-no-undefined-references

JSON →
library5.0.2jsnpmunverified

remark-lint rule to warn when Markdown references to undefined definitions are found. Current stable version: 5.0.2. Released as part of the remark-lint monorepo; patch updates follow release cadence of the monorepo. Differentiator: catches broken links in Markdown documents by ensuring all `[text][reference]` and `[text][]` references have a corresponding `[reference]: URL` definition. Supports options to allow shortcut references and custom allow-lists. Ships TypeScript types and is ESM-only from v5.

npm install remark-lint-no-undefined-references
INSTALL
IMPORT
SIG · REMARK-LINT-NO-UND
R
remark-lint-no-undefined-references
testingjavascriptv5.0.2
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.

remarkLintNoUndefinedReferences
import remarkLintNoUndefinedReferences from 'remark-lint-no-undefined-references'
import { remarkLintNoUndefinedReferences } from 'remark-lint-no-undefined-references'
The package has a default export. Named import will result in undefined.
Options
import type { Options } from 'remark-lint-no-undefined-references'
import { Options } from 'remark-lint-no-undefined-references'
Options is a TypeScript type, not a runtime value. Use type import.
require() usage
const remarkLintNoUndefinedReferences = require('remark-lint-no-undefined-references').default
const remarkLintNoUndefinedReferences = require('remark-lint-no-undefined-references')
Since v5, the package is ESM-only. In CJS environments, you must use .default or dynamic import().

Sets up a unified pipeline to lint a Markdown file for undefined references, allowing shortcut links.

import { unified } from 'unified' import remarkParse from 'remark-parse' import remarkStringify from 'remark-stringify' import remarkLint from 'remark-lint' import remarkLintNoUndefinedReferences from 'remark-lint-no-undefined-references' import { read } from 'to-vfile' import { reporter } from 'vfile-reporter' const file = await read('example.md') await unified() .use(remarkParse) .use(remarkLint) .use(remarkLintNoUndefinedReferences, { allowShortcutLink: true }) .use(remarkStringify) .process(file) console.error(reporter(file))
remark --version
Debug
Known issues
breakingPackage is now ESM-only. CJS require() no longer works without .default.
fix
Use dynamic import() or require('...').default if using CommonJS.
affects: >=5.0.0
deprecatedOptions allowShortcutLink default changed from true to false in v5.
fix
Set allowShortcutLink: true explicitly if you need the old behavior.
affects: >=5.0.0
breakingNode.js version requirement raised to 16+.
fix
Upgrade Node.js to 16 or later.
affects: >=5.0.0
gotchaThe rule does not check inline links like [text](url) or images ![alt](url) — only reference-style links.
fix
Use remark-lint-no-undefined-references only for reference links; for other link checks use additional rules.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'remark-lint-no-undefined-references'
Package not installed or incorrect import path.
fix
npm install remark-lint-no-undefined-references
TypeError: remarkLintNoUndefinedReferences is not a function
Using named import instead of default import in ESM.
fix
Use `import remarkLintNoUndefinedReferences from 'remark-lint-no-undefined-references'` (no braces).
Upgrade
Version history
5.0.2latest on npm
Audit
Dependencies
unified-lint-rulerequiredProvides the lint rule interface for unified
vfilerequiredUsed internally for location and message handling
Agent activity
7 hits · last 30 days
node
6
Resources
remark-lint-no-undefined-references — npm install remark-lint-no-undefined-references · libregistry