remark-lint-double-link
raw JSON → 0.2.0 verified Fri May 01 auth: no javascript
remark-lint rule to detect duplicate link URLs in Markdown files. Current stable version is 0.2.0, with sparse releases on-demand. Differentiates from other lint rules by focusing solely on duplicate URLs, not link text or other attributes. Provides both CLI and config integration via `.remarkrc`. Ships TypeScript declarations.
Common errors
error TypeError: remarkLintDoubleLink is not a function ↓
cause Using CommonJS require on an ESM-only package.
fix
Replace require with import statement.
error import { rule } from 'remark-lint-double-link' // returns undefined ↓
cause Named import 'rule' might be the default export in older versions.
fix
Use default import: import remarkLintDoubleLink from 'remark-lint-double-link'
Warnings
breaking ESM-only since v0.2.0, require() fails. ↓
fix Use import syntax or upgrade bundler/Node to support ESM.
Install
npm install remark-lint-double-link yarn add remark-lint-double-link pnpm add remark-lint-double-link Imports
- default wrong
const remarkLintDoubleLink = require('remark-lint-double-link')correctimport remarkLintDoubleLink from 'remark-lint-double-link' - remarkLintDoubleLink
import { default as remarkLintDoubleLink } from 'remark-lint-double-link' - rule
import { rule } from 'remark-lint-double-link'
Quickstart
import { read } from 'to-vfile';
import { remark } from 'remark';
import remarkLint from 'remark-lint';
import remarkLintDoubleLink from 'remark-lint-double-link';
const file = await remark()
.use(remarkLint)
.use(remarkLintDoubleLink)
.process(await read('example.md'));
console.log(file.messages);