A remark-lint rule that warns when fenced code blocks lack a language flag (infostring) or use an unrecognized one. Current stable version 4.2.0, released as part of the remark-lint monorepo with regular updates tied to remark ecosystem releases. Differentiates from generic linting by optionally validating against GitHub Linguist flags, ensuring code highlighting compatibility. Ships TypeScript definitions, ESM-only, requires Node.js 16+. Part of the remark-lint preset family.
npm install remark-lint-fenced-code-flagNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates how to set up a unified pipeline with remark-lint and the fenced-code-flag rule, reading a markdown file, processing with options, and reporting lint warnings.
Use import statements. If required in CommonJS, use dynamic import() or downgrade to version 3.x.
Update Node.js to version 16 or later.
Use the checkGithubLinguistFlag imported utility to validate flags against GitHub Linguist.
Pass options as { allowEmpty: true, allowed: ['js', 'ts'] } for clarity.Convert your project to ESM (use import/export) or use dynamic import: const m = await import('remark-lint-fenced-code-flag')Ensure you have .use(remarkLint) before the rule: unified().use(remarkParse).use(remarkLint).use(remarkLintFencedCodeFlag)