Registry /
testing / remark-lint-code-block-style
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.
remarkLintCodeBlockStyle
✓ import remarkLintCodeBlockStyle from 'remark-lint-code-block-style'
✗ import { remarkLintCodeBlockStyle } from 'remark-lint-code-block-style'
Default export only. Named import is incorrect. ESM-only since v4.
Options
✓ import type { Options } from 'remark-lint-code-block-style'
✗ import { Options } from 'remark-lint-code-block-style' (type-only import preferred)
TypeScript type export, not runtime.
Style
✓ import type { Style } from 'remark-lint-code-block-style'
TypeScript type export for style values: 'indented' | 'fenced'.
CommonJS require
✓ const remarkLintCodeBlockStyle = require('remark-lint-code-block-style').default
✗ const { remarkLintCodeBlockStyle } = require('remark-lint-code-block-style')
ESM-only; CommonJS requires .default access. Not recommended.
Shows how to set up remark-lint with this rule to enforce fenced code blocks and report lint warnings.
import remarkLint from 'remark-lint'
import remarkLintCodeBlockStyle from 'remark-lint-code-block-style'
import remarkParse from 'remark-parse'
import remarkStringify from 'remark-stringify'
import { read } from 'to-vfile'
import { unified } from 'unified'
import { reporter } from 'vfile-reporter'
const file = await read('example.md')
await unified()
.use(remarkParse)
.use(remarkLint)
.use(remarkLintCodeBlockStyle, { style: 'fenced' })
.use(remarkStringify)
.process(file)
console.error(reporter(file))
Errors
Common errors & fixes
SyntaxError: Named export 'remarkLintCodeBlockStyle' not found. The requested module 'remark-lint-code-block-style' is a CommonJS module, which may not support all module.exports as named exports.
Attempting named import instead of default import.
fixUse `import remarkLintCodeBlockStyle from 'remark-lint-code-block-style'` (default import).
Error: Cannot find module 'remark-lint-code-block-style'
Package not installed or ESM module not resolved in CommonJS environment.
fixEnsure package is installed: `npm install remark-lint-code-block-style`. If in CommonJS, use dynamic import: `const mod = await import('remark-lint-code-block-style')`. TypeError: remarkLintCodeBlockStyle is not a function
Using `require('remark-lint-code-block-style')` without `.default` in ESM-only package.
fixUse `const remarkLintCodeBlockStyle = require('remark-lint-code-block-style').default` in CommonJS, or switch to import. Audit
Dependencies
unifiedrequiredRequired to integrate as a remark plugin
remark-lintoptionalProvides the linting infrastructure (optional if used directly but recommended)