Registry / testing / remark-lint-no-duplicate-defined-urls

remark-lint-no-duplicate-defined-urls

JSON →
library3.0.1jsnpmunverified

A remark-lint rule that warns when the same URL is defined multiple times in Markdown definitions. Current stable version is 3.0.1. It is part of the remark-lint ecosystem, focusing on detecting duplicate URLs to prevent mistakes. Unlike other lint rules that check for unused definitions, this targets duplicate URLs. It is ESM-only and requires Node.js 16+. Released as part of the remark-lint monorepo with regular updates.

npm install remark-lint-no-duplicate-defined-urls
INSTALL
IMPORT
SIG · REMARK-LINT-NO-DUP
R
remark-lint-no-duplicate-defined-urls
testingjavascriptv3.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.

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))
Debug
Known issues
breakingPackage is ESM-only since v3. CommonJS require will fail.
fix
Use import syntax instead of require().
affects: >=3.0.0
deprecatedSupport for Node.js versions below 16 is dropped as of v3.
fix
Upgrade Node.js to v16 or later.
affects: >=3.0.0
gotchaThe package is a default export, not a named export. Using named import will result in undefined.
fix
Use default import: import remarkLintNoDuplicateDefinedUrls from 'remark-lint-no-duplicate-defined-urls'
affects: >=1.0.0
gotchaThis rule must be used with remark-lint; it will not work if remark-lint is not in the plugin chain.
fix
Ensure .use(remarkLint) is called before this rule.
affects: >=1.0.0
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.
fix
Change 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.
fix
Remove or rename one of the duplicate definitions.
TypeError: remarkLintNoDuplicateDefinedUrls is not a function
Using named import { remarkLintNoDuplicateDefinedUrls } instead of default import.
fix
Remove curly braces: import remarkLintNoDuplicateDefinedUrls from ...
Upgrade
Version history
3.0.1latest on npm
Audit
Dependencies
remark-lintrequiredrequired peer dependency to provide the linting framework
Agent activity
4 hits · last 30 days
node
4
Resources
remark-lint-no-duplicate-defined-urls — npm install remark-lint-no-duplicate-defined-urls · libregistry