Registry / testing / remark-lint-no-file-name-irregular-characters

remark-lint-no-file-name-irregular-characters

JSON →
library3.0.1jsnpmunverified

A remark-lint rule that warns when Markdown file names contain characters outside a configurable allowed set (default: alphanumeric, dash, dot). Current stable version is 3.0.1. It is part of the unified/remark ecosystem, maintained by the remark organization, and follows semantic versioning. Key differentiator: allows custom regex patterns to define which characters are irregular, enabling project-specific naming conventions. Supports ESM only, Node.js 16+, and TypeScript types.

npm install remark-lint-no-file-name-irregular-characters
INSTALL
IMPORT
SIG · REMARK-LINT-NO-FIL
R
remark-lint-no-file-name-irregular-characters
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.

default
import remarkLintNoFileNameIrregularCharacters from 'remark-lint-no-file-name-irregular-characters'
const remarkLintNoFileNameIrregularCharacters = require('remark-lint-no-file-name-irregular-characters')
This package is ESM-only since v3; no CJS support.

Configures remark with the lint rule to check file names for irregular characters, processes a Markdown file, and reports messages.

import remarkLint from 'remark-lint'; import remarkLintNoFileNameIrregularCharacters from 'remark-lint-no-file-name-irregular-characters'; 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(remarkLintNoFileNameIrregularCharacters) .use(remarkStringify) .process(file); console.error(reporter(file));
Debug
Known issues
breakingThis package is ESM-only from version 3.0.0 onwards. Importing with require() will fail.
fix
Use import syntax instead of require(). If you need CJS, stick with version 2.x.
affects: >=3.0.0
breakingNode.js version <16 is no longer supported from version 3.0.0.
fix
Upgrade Node.js to version 16 or later.
affects: >=3.0.0
gotchaThe options parameter can be a string or RegExp. If string, it is used as the allowed characters set (inverted to form the irregular pattern). Be careful to escape regex special characters in the string.
fix
Check your options string: it should represent allowed characters, e.g., '\.a-z0-9' for dots, lowercase letters, and digits.
affects: >=1.0.0
gotchaThe default regular expression allows only letters (A-Za-z), digits (0-9), dash (-), and dot (.). Underscores and spaces are considered irregular.
fix
If you need underscores, pass a custom options string like '\.a-z0-9_' or a RegExp.
affects: >=1.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module
Using require() to import an ESM-only package (v3+).
fix
Change to import:
import remarkLintNoFileNameIrregularCharacters from 'remark-lint-no-file-name-irregular-characters'
Unexpected character `_` in file name
The underscore is not in the allowed characters set by default.
fix
Configure the plugin with an options string that includes underscore:
.use(remarkLintNoFileNameIrregularCharacters, '\.a-z0-9_')
Upgrade
Version history
3.0.1latest on npm
Audit
Dependencies
unified-lint-rulerequiredCore dependency for creating remark-lint rules
Agent activity
4 hits · last 30 days
node
4
Resources
remark-lint-no-file-name-irregular-characters — npm install remark-lint-no-file-name-irregular-characters · libregistry