Registry / testing / remark-lint-no-empty-url

remark-lint-no-empty-url

JSON →
library4.0.1jsnpmunverified

remark-lint rule to warn on empty URLs in links, images, and definitions. Version 4.0.1 is the current stable release, compatible with unified ecosystem and Node.js 16+. ESM-only since v3. Differentiates from generic linting by providing focused, low-overhead checks for empty URLs in Markdown, with no configuration options needed.

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

remarkLintNoEmptyUrl
✓ import remarkLintNoEmptyUrl from 'remark-lint-no-empty-url'
✗ const remarkLintNoEmptyUrl = require('remark-lint-no-empty-url')
Package is ESM-only since v3. CommonJS require will fail.
remarkLint
✓ import remarkLint from 'remark-lint'
✗ const remarkLint = require('remark-lint')
remark-lint must be imported alongside this rule. Also ESM-only.
remarkParse
✓ import remarkParse from 'remark-parse'
Required for parsing Markdown before linting.

Demonstrates setting up the remark lint pipeline with the no-empty-url rule, parsing Markdown and reporting warnings.

import remarkLint from 'remark-lint' import remarkLintNoEmptyUrl from 'remark-lint-no-empty-url' import remarkParse from 'remark-parse' import remarkStringify from 'remark-stringify' import {read} from 'to-vfile' import {unified} from 'unified' import {reporter} from 'vfile-reporter' const file = await read('example.md') await unified() .use(remarkParse) .use(remarkLint) .use(remarkLintNoEmptyUrl) .use(remarkStringify) .process(file) console.error(reporter(file))
Debug
Known issues
breakingv3 dropped CommonJS support; package is ESM-only.
fix
Use ES module import syntax or switch to v2 if CJS required.
affects: >=3.0.0
deprecatedv2.x is deprecated and no longer maintained.
fix
Upgrade to v4.0.1 and use ESM import.
affects: <3.0.0
gotchaThis rule must be used after remark-parse and remark-stringify in the pipeline, otherwise it may not detect empty URLs.
fix
Ensure pipeline order: .use(remarkParse).use(remarkLint).use(remarkLintNoEmptyUrl).use(remarkStringify)
affects: >=1.0.0
gotchaThe rule reports empty URLs even when the empty URL is intended (e.g., for placeholder).
fix
If intentional, use a different rule or disable this one.
affects: >=1.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported.
Using require() on an ESM-only package.
fix
Change to dynamic import or use ESM syntax.
TypeError: Cannot read properties of null (reading 'url')
Missing unified plugins in pipeline.
fix
Add .use(remarkParse) and .use(remarkStringify) before processing.
No files matching the pattern were found
CLI glob pattern not matching Markdown files.
fix
Use correct pattern, e.g., '**/*.md'.
Upgrade
Version history
4.0.1latest on npm
Audit
Dependencies
unifiedrequiredCore unified engine required
remark-lintrequiredParent lint plugin providing framework
remark-parserequiredMarkdown parser needed to process AST
remark-stringifyrequiredStringifier for output
Agent activity
6 hits · last 30 days
node
4
OpenAI (training)
2
Resources
remark-lint-no-empty-url — npm install remark-lint-no-empty-url · libregistry