remark-lint-no-unneeded-full-reference-link

raw JSON →
4.0.1 verified Fri May 01 auth: no javascript

A remark-lint rule (v4.0.1, ESM-only, ships TypeScript types) that warns when full reference links like `[text][label]` can be collapsed to `[text][]` because the label matches the text. Part of the remark-lint ecosystem, it helps enforce consistent reference link syntax. No configuration options. Active development with frequent releases.

error Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/remark-lint-no-unneeded-full-reference-link/index.js from /path/to/project/index.js not supported.
cause Using CommonJS require() on an ESM-only package.
fix
Convert your project to ESM (add "type": "module" in package.json) or use dynamic import().
error Cannot find module 'remark-lint-no-unneeded-full-reference-link'
cause Package not installed or incorrect import path.
fix
Run 'npm install remark-lint-no-unneeded-full-reference-link' and ensure your import/require path matches the package name.
breaking ESM-only: this package dropped CommonJS support in v4.0.0.
fix Switch to ESM imports: use import syntax instead of require().
breaking Node.js 16+ required as of v4.0.0 due to ESM-only adoption.
fix Upgrade Node.js to version 16 or later, or use an older version (v3.x) which supports CJS.
gotcha The rule has no configuration options; attempting to pass options will be silently ignored.
fix Do not pass options to .use().
npm install remark-lint-no-unneeded-full-reference-link
yarn add remark-lint-no-unneeded-full-reference-link
pnpm add remark-lint-no-unneeded-full-reference-link

Shows how to use the rule with unified, reading a markdown file, and reporting lint messages.

import { unified } from 'unified';
import remarkParse from 'remark-parse';
import remarkLint from 'remark-lint';
import remarkStringify from 'remark-stringify';
import remarkLintNoUnneededFullReferenceLink from 'remark-lint-no-unneeded-full-reference-link';
import { reporter } from 'vfile-reporter';
import { read } from 'to-vfile';

const file = await read('example.md');

await unified()
  .use(remarkParse)
  .use(remarkLint)
  .use(remarkLintNoUnneededFullReferenceLink)
  .use(remarkStringify)
  .process(file);

console.error(reporter(file));