Registry / testing / remark-lint-no-reference-like-url

remark-lint-no-reference-like-url

JSON →
library4.0.1jsnpmunverified

remark-lint rule that warns when URLs are also defined identifiers, helping catch likely broken references in Markdown. Current version 4.0.1, part of the remark-lint monorepo. ESM-only, requires Node.js 16+. No presets include it; use as a standalone lint rule. Differentiates from other lint rules by focusing on the specific pattern of resource links that should be reference links to avoid ambiguity.

npm install remark-lint-no-reference-like-url
INSTALL
IMPORT
SIG · REMARK-LINT-NO-REF
R
remark-lint-no-reference-like-url
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.

remarkLintNoReferenceLikeUrl
import remarkLintNoReferenceLikeUrl from 'remark-lint-no-reference-like-url'
import { remarkLintNoReferenceLikeUrl } from 'remark-lint-no-reference-like-url'
Default export only; named export is incorrect since v1.
plugin usage
.use(remarkLintNoReferenceLikeUrl)
.use(remarkLintNoReferenceLikeUrl())
Do not call the function; pass it directly.
require in CJS
const remarkLintNoReferenceLikeUrl = require('remark-lint-no-reference-like-url')
const { remarkLintNoReferenceLikeUrl } = require('remark-lint-no-reference-like-url')
Removed in v3. Use import or dynamic import.

Demonstrates how to use the rule to lint Markdown and detect resource links that look like references.

import { unified } from 'unified'; import remarkParse from 'remark-parse'; import remarkStringify from 'remark-stringify'; import remarkLint from 'remark-lint'; import remarkLintNoReferenceLikeUrl from 'remark-lint-no-reference-like-url'; import { reporter } from 'vfile-reporter'; const file = await unified() .use(remarkParse) .use(remarkLint) .use(remarkLintNoReferenceLikeUrl) .use(remarkStringify) .process('[**Mercury**](mercury) is the first planet from the sun.\n\n[mercury]: https://example.com/mercury/'); console.error(reporter(file));
Debug
Known issues
breakingCommonJS require() is no longer supported. Use ESM imports.
fix
Change your code to use import or dynamic import()
affects: >=3.0.0
deprecatedThe plugin is not included in any preset and must be added explicitly.
fix
Ensure you add it as a separate plugin in your remark configuration
affects: >=1.0.0
gotchaThe rule does not have options, but some users try to pass configuration; it's a simple boolean check.
fix
Do not pass any arguments to .use(). There are no options.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'remark-lint-no-reference-like-url'
Package not installed or wrong version
fix
npm install remark-lint-no-reference-like-url
TypeError: Illegal invocation: function must be called without new
Calling the plugin instead of passing it directly
fix
.use(remarkLintNoReferenceLikeUrl) not .use(remarkLintNoReferenceLikeUrl())
ERR_REQUIRE_ESM
Trying to require() an ESM-only package
fix
Use import or dynamic import()
Upgrade
Version history
4.0.1latest on npm
Audit
Dependencies
unifiedrequiredPlugin interface dependency
remark-lintrequiredProvides linting framework
Agent activity
2 hits · last 30 days
node
2
Resources
remark-lint-no-reference-like-url — npm install remark-lint-no-reference-like-url · libregistry