A remark-lint rule to warn when a file's extension does not match a configured style. Current stable version is 3.0.1, part of the remark-lint monorepo with regular updates. It checks file extensions against a list of allowed values, supports allowing extensionless files (default true), and provides a TypeScript type for configuration. Key differentiator: it enforces consistent file naming conventions in markdown projects, useful for ensuring .md vs .mdx compliance. ESM-only since v3, requires Node.js 16+.
npm install remark-lint-file-extensionNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to use remark-lint-file-extension with the unified API to validate a file's extension.
Use import or dynamic import() instead of require(). For Node.js, ensure "type": "module" in package.json or use .mjs extension.
Upgrade Node.js to v16 or later, or use an older version (v2.x) of the package.
Explicitly set extensions option if you need different values.
Ensure .use(remarkLint) is called before .use(remarkLintFileExtension).
Run 'npm install remark-lint-file-extension' and ensure import path matches: 'remark-lint-file-extension'
Use 'import' syntax or 'import()' dynamic import. For old projects, stick to version 2.x.
Make sure to call .use(remarkLint) before .use(remarkLintFileExtension).