Registry / testing / remark-lint-no-unneeded-full-reference-image

remark-lint-no-unneeded-full-reference-image

JSON →
library4.0.1jsnpmunverified

remark-lint rule that warns when full reference images (`![Alt][alt]`) can be collapsed to `![Alt][]` because the label matches the alt text. Version 4.0.1 is the current stable release from the remark-lint monorepo. ESM-only, ships TypeScript types, no options. Ideal for maintaining image reference consistency in markdown projects. Compared to other lint rules, this one is narrowly focused on image reference style and integrates seamlessly into unified/remark ecosystem without configuration.

npm install remark-lint-no-unneeded-full-reference-image
INSTALL
IMPORT
SIG · REMARK-LINT-NO-UNN
R
remark-lint-no-unneeded-full-reference-image
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.

remarkLintNoUnneededFullReferenceImage
✓ import remarkLintNoUnneededFullReferenceImage from 'remark-lint-no-unneeded-full-reference-image'
✗ const { remarkLintNoUnneededFullReferenceImage } = require('remark-lint-no-unneeded-full-reference-image')
ESM-only since v3; no named export, default export only.
unified
✓ import { unified } from 'unified'
✗ const unified = require('unified')
unified is ESM-only from v10 onward.
reporter
✓ import { reporter } from 'vfile-reporter'
✗ import reporter from 'vfile-reporter'
vfile-reporter v8+ exports reporter as named export, not default.

Shows how to import and use the lint rule with unified, parse, stringify, and the vfile reporter.

import { unified } from 'unified' import remarkParse from 'remark-parse' import remarkStringify from 'remark-stringify' import remarkLint from 'remark-lint' import remarkLintNoUnneededFullReferenceImage from 'remark-lint-no-unneeded-full-reference-image' import { reporter } from 'vfile-reporter' import { read } from 'to-vfile' const file = await read('example.md') await unified() .use(remarkParse) .use(remarkLint) .use(remarkLintNoUnneededFullReferenceImage) .use(remarkStringify) .process(file) console.error(reporter(file))
Debug
Known issues
breakingESM only since v3; no CommonJS support.
fix
Use import syntax instead of require().
affects: >=3.0.0
breakingv3+ requires remark-lint >=10.0.0 and unified >=11.0.0.
fix
Update peer dependencies: unified@11, remark-lint@10.
affects: >=3.0.0
deprecatedv2 used a different default export name (index).
fix
Upgrade to v3+ and use the default import as shown.
affects: =2.0.0
gotchaNo options accepted; rule behavior cannot be customized.
fix
Use a different rule or custom plugin if tailoring is needed.
affects: >=1.0.0
gotchaRule checks full reference images only; does not affect collapsed or shortcut references.
fix
Understand scope: only triggers on images like `![alt][alt]`.
affects: >=1.0.0
Errors
Common errors & fixes
Dynamic require of "remark-lint-no-unneeded-full-reference-image" is not supported
Using require() on an ESM-only package.
fix
Change to import or ensure Node.js is in ESM mode.
Could not resolve "remark-lint"
Missing required peer dependency remark-lint.
fix
Install remark-lint alongside this package.
Unexpected full reference image (`![text][label]`) where the identifier can be inferred from the text, expected collapsed reference (`![text][]`)
Image reference where label matches alt text can be collapsed.
fix
Change `![alt][alt]` to `![alt][]`.
Upgrade
Version history
4.0.1latest on npm
Audit
Dependencies
remark-lintrequiredmust be applied alongside the base remark-lint plugin
Agent activity
2 hits · last 30 days
node
2
Resources
remark-lint-no-unneeded-full-reference-image — npm install remark-lint-no-unneeded-full-reference-image · libregistry