remark-lint-no-file-name-articles
raw JSON → 3.0.1 verified Fri May 01 auth: no javascript
A remark-lint rule that warns when Markdown file names start with articles such as "a", "an", or "the". Current stable version is 3.0.1, released as part of the remark-lint monorepo. It is ESM-only (Node.js 16+), ships TypeScript types, and has no configurable options. Unlike generic lint rules, this is specifically tailored for documentation sites and publishing workflows where article-prefixed filenames are considered poor practice.
Common errors
error ERR_REQUIRE_ESM ↓
cause Trying to require() an ESM-only package in Node.js with CommonJS.
fix
Use import or switch to Node.js 16+ with type: "module" in package.json.
error TypeError: (0 , remarkLintNoFileNameArticles) is not a function ↓
cause Named import used incorrectly; this package exports a default only.
fix
Use
import remarkLintNoFileNameArticles from 'remark-lint-no-file-name-articles' (no braces). Warnings
breaking v3 requires ESM and Node.js 16+. No CommonJS support. ↓
fix Migrate to ESM or stay on v2 (if still available).
deprecated v2 is deprecated and no longer maintained. ↓
fix Upgrade to v3 (requires ESM).
gotcha This rule only checks the file basename, not the entire path. It does not inspect directories. ↓
fix Use another rule or custom plugin for directory name linting.
gotcha The rule has no configurable options. It checks against a fixed set of English articles (a, an, the) and does not support other languages. ↓
fix If you need custom article lists, consider contributing or using a more flexible lint rule.
Install
npm install remark-lint-no-file-name-articles yarn add remark-lint-no-file-name-articles pnpm add remark-lint-no-file-name-articles Imports
- remarkLintNoFileNameArticles wrong
import { remarkLintNoFileNameArticles } from 'remark-lint-no-file-name-articles'correctimport remarkLintNoFileNameArticles from 'remark-lint-no-file-name-articles' - remarkLintNoFileNameArticles (CLI usage) wrong
remark --use remark-lint-no-file-name-articles .correctremark --use remark-lint --use remark-lint-no-file-name-articles . - (TypeScript type usage) wrong
Does not export custom types; rely on @types/unified and @types/remark-lintcorrectimport type * as unified from 'unified'; import type { Plugin } from 'remark-lint';
Quickstart
import { unified } from 'unified'
import remarkParse from 'remark-parse'
import remarkStringify from 'remark-stringify'
import remarkLint from 'remark-lint'
import remarkLintNoFileNameArticles from 'remark-lint-no-file-name-articles'
import { read } from 'to-vfile'
import { reporter } from 'vfile-reporter'
const file = await read('the-title.md')
await unified()
.use(remarkParse)
.use(remarkLint)
.use(remarkLintNoFileNameArticles)
.use(remarkStringify)
.process(file)
console.error(reporter(file))
// => '1:1: Unexpected file name starting with `the`, remove it'