Registry / testing / remark-lint-no-literal-urls

remark-lint-no-literal-urls

JSON →
library4.0.1jsnpmunverified

A remark-lint rule that warns when GFM autolink literals (bare URLs) are used, enforcing the use of angle-bracket autolinks or full Markdown links. Version 4.0.1 is the latest stable release, part of the remark-lint monorepo with regular updates. It is ESM-only, ships TypeScript types, and integrates with unified and remark-lint. Unlike alternatives, it specifically targets the GFM autolink literal syntax introduced by remark-gfm. Recommended for ensuring link consistency across environments where raw URLs may not be recognized.

npm install remark-lint-no-literal-urls
INSTALL
IMPORT
SIG · REMARK-LINT-NO-LIT
R
remark-lint-no-literal-urls
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.

remarkLintNoLiteralUrls
import remarkLintNoLiteralUrls from 'remark-lint-no-literal-urls'
const remarkLintNoLiteralUrls = require('remark-lint-no-literal-urls')
Package is ESM-only since v4; requires Node.js 16+ and type=m in package.json
remarkLintNoLiteralUrls
import remarkLintNoLiteralUrls from 'https://esm.sh/remark-lint-no-literal-urls@4'
import remarkLintNoLiteralUrls from 'https://cdn.skypack.dev/remark-lint-no-literal-urls'
For Deno, use esm.sh; Skypack may not support the package correctly
remarkLintNoLiteralUrls
await unified().use(remarkLint).use(remarkLintNoLiteralUrls).process(file)
unified().use(remarkLintNoLiteralUrls).process(file) // Missing remarkLint plugin
The rule requires remarkLint to be used first in the chain

Demonstrates how to use remark-lint-no-literal-urls in a Node.js ESM environment with unified, remark-parse, remark-stringify, and remark-lint.

import { unified } from 'unified' import remarkParse from 'remark-parse' import remarkStringify from 'remark-stringify' import remarkLint from 'remark-lint' import remarkLintNoLiteralUrls from 'remark-lint-no-literal-urls' import { read } from 'to-vfile' import { reporter } from 'vfile-reporter' const file = await read('example.md') await unified() .use(remarkParse) .use(remarkLint) .use(remarkLintNoLiteralUrls) .use(remarkStringify) .process(file) console.error(reporter(file))
Debug
Known issues
breakingPackage is ESM-only starting from v4. CommonJS require() will fail.
fix
Switch to import syntax and ensure project uses 'type': 'module' or .mjs extension.
affects: >=4.0.0
deprecatedThis rule may be deprecated in future versions of remark-lint as GFM autolink literals become more widely supported.
fix
Consider whether the rule is still needed for your project; migrate to using remark-gfm with proper configuration if possible.
affects: >=4.0.0
gotchaThe rule only applies when GFM is enabled via remark-gfm. Without it, literal URLs are not processed and the rule will have no effect.
fix
Ensure remark-gfm is used in the unified pipeline before this rule.
affects: >=1.0.0
Errors
Common errors & fixes
ERR_REQUIRE_ESM: require() of ES Module /path/to/remark-lint-no-literal-urls/index.js from /path/to/project/index.js not supported.
Using require() on an ESM-only package.
fix
Use import syntax or convert your project to ESM (type: 'module' in package.json).
Error: Cannot find module 'unified-lint-rule'
Missing peer dependency 'unified-lint-rule' (installed automatically with remark-lint, but may need explicit install in some setups).
fix
Install unified-lint-rule: npm install unified-lint-rule
TypeError: remarkLintNoLiteralUrls is not a function
Incorrect import (e.g., named import instead of default).
fix
Use default import: import remarkLintNoLiteralUrls from 'remark-lint-no-literal-urls'
Upgrade
Version history
4.0.1latest on npm
Audit
Dependencies
unified-lint-rulerequiredprovides the rule infrastructure
remark-lintrequiredlint framework required to use the rule
Agent activity
2 hits · last 30 days
node
2
Resources
remark-lint-no-literal-urls — npm install remark-lint-no-literal-urls · libregistry