remark-lint-no-file-name-mixed-case

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

remark-lint rule to warn when file names use mixed case (e.g., 'MyFile.md' instead of 'myfile.md' or 'MYFILE.md'). Version 3.0.1 is the current stable release, published as part of the remark-lint monorepo. This package helps enforce consistent casing for Markdown file names in projects. It is ESM-only, requires Node.js 16+, and integrates with unified/remark. No configuration options.

error Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/remark-lint-no-file-name-mixed-case/index.js from /path/to/file.js not supported.
cause Using CommonJS require() to import an ESM-only package.
fix
Change to import statement or use dynamic import().
error SyntaxError: The requested module 'remark-lint-no-file-name-mixed-case' does not provide an export named 'remarkLintNoFileNameMixedCase'
cause Trying to import a named export when the package only has a default export.
fix
Use default import: import remarkLintNoFileNameMixedCase from 'remark-lint-no-file-name-mixed-case'
error Error: Cannot find package 'remark-lint' from '...'
cause remark-lint is not installed. The plugin depends on remark-lint to function.
fix
Install remark-lint: npm install remark-lint
breaking Package is ESM-only; CommonJS require() will throw ERR_REQUIRE_ESM.
fix Use import or dynamic import().
deprecated Options parameter is not supported; the plugin takes no options.
fix Do not pass any options when using the plugin.
gotcha The plugin checks the file name, not the content. It will warn for files like 'Mercury.md' (mixed case).
fix Use lowercase or uppercase file names consistently.
gotcha The plugin requires remark-lint to be used as a separate plugin. Omitting remark-lint will result in no linting.
fix Ensure remark-lint is added to the unified pipeline.
gotcha Node.js version must be >=16. Using older versions will cause failures.
fix Upgrade Node.js to version 16 or later.
npm install remark-lint-no-file-name-mixed-case
yarn add remark-lint-no-file-name-mixed-case
pnpm add remark-lint-no-file-name-mixed-case

Shows how to use the plugin with unified API to lint file names for mixed case.

import { unified } from 'unified';
import remarkParse from 'remark-parse';
import remarkStringify from 'remark-stringify';
import remarkLint from 'remark-lint';
import remarkLintNoFileNameMixedCase from 'remark-lint-no-file-name-mixed-case';
import { read } from 'to-vfile';
import { reporter } from 'vfile-reporter';

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

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

console.error(reporter(file));