Registry /
testing / remark-lint-no-duplicate-defined-urls
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.
remarkLintNoDuplicateDefinedUrls
✓ import remarkLintNoDuplicateDefinedUrls from 'remark-lint-no-duplicate-defined-urls'
✗ const remarkLintNoDuplicateDefinedUrls = require('remark-lint-no-duplicate-defined-urls')
Package is ESM-only since v3. CommonJS require will fail.
default export
✓ import remarkLintNoDuplicateDefinedUrls from 'remark-lint-no-duplicate-defined-urls'
✗ import { remarkLintNoDuplicateDefinedUrls } from 'remark-lint-no-duplicate-defined-urls'
The package exports a default function, not a named export.
type import
✓ import type { Transformer } from 'unified'
Package does not export additional TypeScript types; use unified types if needed.
Set up remark-lint with the no-duplicate-defined-urls rule, parse a Markdown file, and report any lint messages.
import remarkLint from 'remark-lint'
import remarkLintNoDuplicateDefinedUrls from 'remark-lint-no-duplicate-defined-urls'
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(remarkLintNoDuplicateDefinedUrls)
.use(remarkStringify)
.process(file)
console.error(reporter(file))
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/remark-lint-no-duplicate-defined-urls/index.js not supported.
Using CommonJS require() to load an ESM-only package.
fixChange to import statement or use dynamic import().
Unexpected definition with an already defined URL (as `mercury`), expected unique URLs
Two definitions in the Markdown file point to the same URL.
fixRemove or rename one of the duplicate definitions.
TypeError: remarkLintNoDuplicateDefinedUrls is not a function
Using named import { remarkLintNoDuplicateDefinedUrls } instead of default import.
fixRemove curly braces: import remarkLintNoDuplicateDefinedUrls from ...
Audit
Dependencies
remark-lintrequiredrequired peer dependency to provide the linting framework