{"id":26242,"library":"remark-lint-no-dead-urls","title":"remark-lint-no-dead-urls","description":"A remark-lint rule that checks if URLs in Markdown files are alive by making HTTP requests, using the dead-or-alive library. Current stable version is 2.0.1 (February 2025), released under the unified collective with active maintenance. It differs from remark-validate-links by checking internet URLs rather than local file paths, and can also verify fragment IDs on web pages. ESM-only since v2, requires Node.js 18+.","status":"active","version":"2.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/remarkjs/remark-lint-no-dead-urls","tags":["javascript","lint","markdown","remark-lint-rule","remark-lint","remark","rule","typescript"],"install":[{"cmd":"npm install remark-lint-no-dead-urls","lang":"bash","label":"npm"},{"cmd":"yarn add remark-lint-no-dead-urls","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-lint-no-dead-urls","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"underlying library to check if URLs are reachable","package":"dead-or-alive","optional":false},{"reason":"peer dependency for the rule to work","package":"remark-lint","optional":false}],"imports":[{"note":"ESM-only since v2; CommonJS require does not work.","wrong":"const remarkLintNoDeadUrls = require('remark-lint-no-dead-urls')","symbol":"remarkLintNoDeadUrls","correct":"import remarkLintNoDeadUrls from 'remark-lint-no-dead-urls'"},{"note":"Options is a TypeScript type, use type import.","wrong":"import {Options} from 'remark-lint-no-dead-urls'","symbol":"Options","correct":"import type {Options} from 'remark-lint-no-dead-urls'"},{"note":"The package has a default export, not a named export.","wrong":"import {remarkLintNoDeadUrls} from 'remark-lint-no-dead-urls'","symbol":"Default export","correct":"import remarkLintNoDeadUrls from 'remark-lint-no-dead-urls'"}],"quickstart":{"code":"import remarkLintNoDeadUrls from 'remark-lint-no-dead-urls';\nimport remarkLint from 'remark-lint';\nimport remarkParse from 'remark-parse';\nimport remarkStringify from 'remark-stringify';\nimport {read} from 'to-vfile';\nimport {unified} from 'unified';\nimport {reporter} from 'vfile-reporter';\n\nconst file = await read('example.md');\n\nawait unified()\n  .use(remarkParse)\n  .use(remarkLint)\n  .use(remarkLintNoDeadUrls, {skipLocalhost: true})\n  .use(remarkStringify)\n  .process(file);\n\nconsole.error(reporter(file));","lang":"typescript","description":"Shows how to use the rule in a unified pipeline: parse markdown, lint for dead URLs, stringify, and report."},"warnings":[{"fix":"Use import instead of require().","message":"v2 drops CommonJS support entirely; package is ESM only.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Update Node.js to version 18 or later.","message":"v2 requires Node.js 18 or later.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Replace gotOptions with deadOrAliveOptions in configuration.","message":"Option renamed from gotOptions to deadOrAliveOptions.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Use options.from instead of options.gotOptions.prefixUrl.","message":"The option prefixUrl is replaced with from.","severity":"deprecated","affected_versions":">=2.0.0"},{"fix":"Set skipOffline: true in options to allow offline runs.","message":"If skipOffline is not set, the rule will throw an error when offline.","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":"Run `npm install remark-lint-no-dead-urls` and ensure you are using import (ESM).","cause":"Package not installed or wrong import path.","error":"Error: Cannot find module 'remark-lint-no-dead-urls'"},{"fix":"Change const x = require('...') to import x from '...'.","cause":"Using require() on an ESM-only package.","error":"TypeError: remarkLintNoDeadUrls is not a function"},{"fix":"Provide options.from or set file.data.meta.origin and pathname.","cause":"Relative URLs are present but no from option or file.data.meta.origin/pathname set.","error":"Error: The `from` option is required for relative URLs"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}