remark-lint-no-file-name-consecutive-dashes

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

A remark-lint rule to warn when file names contain consecutive dashes. Part of the remark-lint ecosystem for linting Markdown. Current stable version 3.0.1, ESM-only, requires Node.js 16+. No options. Ships TypeScript types. Released under the unified collective. Release cadence follows remark-lint monorepo updates.

error Cannot find module 'remark-lint-no-file-name-consecutive-dashes'
cause Package not installed or incorrect import path.
fix
Run npm install remark-lint-no-file-name-consecutive-dashes and ensure import path matches.
error import { remarkLintNoFileNameConsecutiveDashes } from 'remark-lint-no-file-name-consecutive-dashes'
cause Trying named import, but package exports default only.
fix
Use import remarkLintNoFileNameConsecutiveDashes from 'remark-lint-no-file-name-consecutive-dashes'
error require() of ES Module not supported
cause Package is ESM-only; using require() in CommonJS context.
fix
Use dynamic import() or convert project to ESM.
breaking Package is ESM-only since v3. CommonJS require() will throw an error.
fix Use dynamic import() or switch to ESM.
deprecated No deprecated features known.
gotcha The rule has no options; passing any configuration will be ignored.
fix Do not pass any options; usage is .use(remarkLintNoFileNameConsecutiveDashes) only.
npm install remark-lint-no-file-name-consecutive-dashes
yarn add remark-lint-no-file-name-consecutive-dashes
pnpm add remark-lint-no-file-name-consecutive-dashes

Shows how to use the rule in a unified pipeline to lint a file with consecutive dashes in its name.

import { unified } from 'unified';
import remarkParse from 'remark-parse';
import remarkStringify from 'remark-stringify';
import remarkLint from 'remark-lint';
import remarkLintNoFileNameConsecutiveDashes from 'remark-lint-no-file-name-consecutive-dashes';
import { read } from 'to-vfile';
import { reporter } from 'vfile-reporter';

const file = await read('plug--ins.md');

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

console.error(reporter(file));
// Output: 1:1: Unexpected consecutive dashes in a file name, expected `-`