{"id":26264,"library":"remark-lint-no-literal-urls","title":"remark-lint-no-literal-urls","description":"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.","status":"active","version":"4.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/remarkjs/remark-lint#main","tags":["javascript","lint","literal","remark","remark-lint","remark-lint-rule","rule","url","typescript"],"install":[{"cmd":"npm install remark-lint-no-literal-urls","lang":"bash","label":"npm"},{"cmd":"yarn add remark-lint-no-literal-urls","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-lint-no-literal-urls","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"provides the rule infrastructure","package":"unified-lint-rule","optional":false},{"reason":"lint framework required to use the rule","package":"remark-lint","optional":false}],"imports":[{"note":"Package is ESM-only since v4; requires Node.js 16+ and type=m in package.json","wrong":"const remarkLintNoLiteralUrls = require('remark-lint-no-literal-urls')","symbol":"remarkLintNoLiteralUrls","correct":"import remarkLintNoLiteralUrls from 'remark-lint-no-literal-urls'"},{"note":"For Deno, use esm.sh; Skypack may not support the package correctly","wrong":"import remarkLintNoLiteralUrls from 'https://cdn.skypack.dev/remark-lint-no-literal-urls'","symbol":"remarkLintNoLiteralUrls","correct":"import remarkLintNoLiteralUrls from 'https://esm.sh/remark-lint-no-literal-urls@4'"},{"note":"The rule requires remarkLint to be used first in the chain","wrong":"unified().use(remarkLintNoLiteralUrls).process(file) // Missing remarkLint plugin","symbol":"remarkLintNoLiteralUrls","correct":"await unified().use(remarkLint).use(remarkLintNoLiteralUrls).process(file)"}],"quickstart":{"code":"import { unified } from 'unified'\nimport remarkParse from 'remark-parse'\nimport remarkStringify from 'remark-stringify'\nimport remarkLint from 'remark-lint'\nimport remarkLintNoLiteralUrls from 'remark-lint-no-literal-urls'\nimport { read } from 'to-vfile'\nimport { reporter } from 'vfile-reporter'\n\nconst file = await read('example.md')\n\nawait unified()\n  .use(remarkParse)\n  .use(remarkLint)\n  .use(remarkLintNoLiteralUrls)\n  .use(remarkStringify)\n  .process(file)\n\nconsole.error(reporter(file))","lang":"typescript","description":"Demonstrates how to use remark-lint-no-literal-urls in a Node.js ESM environment with unified, remark-parse, remark-stringify, and remark-lint."},"warnings":[{"fix":"Switch to import syntax and ensure project uses 'type': 'module' or .mjs extension.","message":"Package is ESM-only starting from v4. CommonJS require() will fail.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Consider whether the rule is still needed for your project; migrate to using remark-gfm with proper configuration if possible.","message":"This rule may be deprecated in future versions of remark-lint as GFM autolink literals become more widely supported.","severity":"deprecated","affected_versions":">=4.0.0"},{"fix":"Ensure remark-gfm is used in the unified pipeline before this rule.","message":"The rule only applies when GFM is enabled via remark-gfm. Without it, literal URLs are not processed and the rule will have no effect.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use import syntax or convert your project to ESM (type: 'module' in package.json).","cause":"Using require() on an ESM-only package.","error":"ERR_REQUIRE_ESM: require() of ES Module /path/to/remark-lint-no-literal-urls/index.js from /path/to/project/index.js not supported."},{"fix":"Install unified-lint-rule: npm install unified-lint-rule","cause":"Missing peer dependency 'unified-lint-rule' (installed automatically with remark-lint, but may need explicit install in some setups).","error":"Error: Cannot find module 'unified-lint-rule'"},{"fix":"Use default import: import remarkLintNoLiteralUrls from 'remark-lint-no-literal-urls'","cause":"Incorrect import (e.g., named import instead of default).","error":"TypeError: remarkLintNoLiteralUrls is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}