Registry / remark-lint-no-file-name-outer-dashes

remark-lint-no-file-name-outer-dashes

JSON →
library3.0.1jsnpmunverified

A remark-lint rule that warns when file names start or end with dashes. Current stable version is 3.0.1, compatible with Node.js 16+. It is part of the remark-lint ecosystem and is ESM-only. This rule helps enforce consistent file naming conventions by flagging leading or trailing hyphens, which are often unintended. It is included in the `remark-preset-lint-markdown-style-guide` preset. Releases follow the unified collective's schedule with occasional patches across all packages.

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

remarkLintNoFileNameOuterDashes
import remarkLintNoFileNameOuterDashes from 'remark-lint-no-file-name-outer-dashes'
const remarkLintNoFileNameOuterDashes = require('remark-lint-no-file-name-outer-dashes')
Package is ESM-only since v3; CJS require() will fail.

Shows how to use the rule in Node.js with unified to detect leading dashes in a filename.

import { unified } from 'unified'; import remarkParse from 'remark-parse'; import remarkStringify from 'remark-stringify'; import remarkLint from 'remark-lint'; import remarkLintNoFileNameOuterDashes from 'remark-lint-no-file-name-outer-dashes'; import { read } from 'to-vfile'; import { reporter } from 'vfile-reporter'; const file = await read('-mercury.md'); await unified() .use(remarkParse) .use(remarkLint) .use(remarkLintNoFileNameOuterDashes) .use(remarkStringify) .process(file); console.error(reporter(file)); // Output: 1:1: Unexpected initial or final dashes in file name, expected dashes to join words
remark --version
Debug
Known issues
breakingESM-only: Package is ESM-only since v3. require() will throw an error.
fix
Use import instead of require. For older Node.js, use dynamic import or migrate to ESM.
affects: >=3.0.0
breakingNode.js 16+ required: As of v3, the package requires Node.js 16 or later.
fix
Upgrade Node.js to version 16 or higher.
affects: >=3.0.0
deprecatedNo longer supports Node.js <16: Dropped support for Node.js versions below 16.
fix
Upgrade Node.js to 16+.
affects: >=3.0.0
Errors
Common errors & fixes
Cannot find module 'remark-lint-no-file-name-outer-dashes'
Package not installed or wrong import path.
fix
Run 'npm install remark-lint-no-file-name-outer-dashes' and ensure correct import statement.
ERR_REQUIRE_ESM: require() of ES Module
Using require() with an ESM-only package.
fix
Change to import statement: import remarkLintNoFileNameOuterDashes from 'remark-lint-no-file-name-outer-dashes'
Upgrade
Version history
3.0.1latest on npm
Audit
Dependencies
unifiedrequiredNeeded as the processor framework
remark-lintrequiredRequired to use lint rules
remark-parseoptionalUsed for parsing Markdown in API usage
remark-stringifyoptionalUsed for serializing Markdown in API usage
Agent activity
2 hits · last 30 days
node
2
Resources
remark-lint-no-file-name-outer-dashes — npm install remark-lint-no-file-name-outer-dashes · libregistry