Registry / testing / remark-lint-fenced-code-flag-case

remark-lint-fenced-code-flag-case

JSON →
library3.0.0jsnpmunverified

remark-lint rule to warn when fenced code blocks have an inconsistently-cased language flag. Current stable version is 3.0.0, released as part of the unified-utils monorepo. Release cadence is irregular, with breaking changes tied to minimum node version bumps (now 20.18.0). Key differentiator: unlike similar lint rules, this enforces lowercase flags to ensure compatibility with tools like Prettier that may ignore uppercase or mixed-case flags. Full Unicode support is included. ESM-only, cannot be required with CommonJS.

npm install remark-lint-fenced-code-flag-case
INSTALL
IMPORT
SIG · REMARK-LINT-FENCED
R
remark-lint-fenced-code-flag-case
testingjavascriptv3.0.0
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.

lintFencedCodeFlagCase
import lintFencedCodeFlagCase from 'remark-lint-fenced-code-flag-case'
const lintFencedCodeFlagCase = require('remark-lint-fenced-code-flag-case')
ESM-only package; require() will fail. Default export is the lint rule function.
remark-lint-fenced-code-flag-case (plugin)
.use(lintFencedCodeFlagCase)
.use('remark-lint-fenced-code-flag-case')
Must pass the imported function, not a string name, to .use().
remarkConfig plugins
"plugins": ["remark-lint-fenced-code-flag-case"]
"plugins": ["lint-fenced-code-flag-case"]
In package.json config, use full package name without prefix; in .remarkrc.js, shorthand is allowed.

Lints a Markdown file for inconsistently-cased fenced code block flags using remark-lint and reports warnings.

import { read } from 'to-vfile'; import { reporter } from 'vfile-reporter'; import { remark } from 'remark'; import remarkLint from 'remark-lint'; import lintFencedCodeFlagCase from 'remark-lint-fenced-code-flag-case'; const file = await remark() .use(remarkLint) .use(lintFencedCodeFlagCase) .process(await read('example.md')); console.log(reporter(file));
remark --version
Debug
Known issues
breakingMinimum supported Node.js version is now 20.18.0
fix
Upgrade Node.js to v20.18.0 or later, or stay on v2.x.
affects: >=3.0.0
breakingPackage is ESM-only and cannot be require()'d
fix
Use import syntax; if using CommonJS, use dynamic import().
affects: >=3.0.0
deprecatedShorthand plugin names in .remarkrc.js may not work in future versions
fix
Use full package name 'remark-lint-fenced-code-flag-case' in all configs.
affects: >=3.0.0
gotchaThe rule only checks fenced code blocks that have a language flag; blocks without flags are ignored.
fix
No fix needed; this is by design. To require flags, use another rule.
affects: >=1.0.0
gotchaMixed-case flags like 'TypeScript' are warned but might still get syntax highlighting; only formatting tools are affected.
fix
Lowercase all code block flags to ensure formatting tools work.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'remark-lint-fenced-code-flag-case'
Package not installed or not in node_modules.
fix
Run `npm install --save-dev remark-lint-fenced-code-flag-case`.
SyntaxError: The requested module 'remark-lint-fenced-code-flag-case' does not provide an export named 'default'
Using an incorrect import syntax or trying to import named exports that don't exist.
fix
Use `import lintFencedCodeFlagCase from 'remark-lint-fenced-code-flag-case'` (default import).
TypeError: remark().use is not a function
Forgetting to create a remark instance with `remark()`.
fix
Use `import { remark } from 'remark';` then call `remark().use(...)`.
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies
unified-lint-rulerequiredProvides base class for remark-lint rules
@types/mdastoptionalTypeScript definitions for Markdown AST
Agent activity
2 hits · last 30 days
node
2
Resources
remark-lint-fenced-code-flag-case — npm install remark-lint-fenced-code-flag-case · libregistry