Registry /
testing / remark-preset-lint-recommended
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.
remarkPresetLintRecommended
✓ import remarkPresetLintRecommended from 'remark-preset-lint-recommended'
✗ const remarkPresetLintRecommended = require('remark-preset-lint-recommended')
ESM-only since v7; require() throws in Node < 12 or without --experimental-modules.
remarkPresetLintRecommended (default import)
✓ import remarkPresetLintRecommended from 'remark-preset-lint-recommended'
✗ import { remarkPresetLintRecommended } from 'remark-preset-lint-recommended'
Package exports a single default export; named import yields undefined.
remarkPresetLintRecommended (type import)
✓ import type { Preset } from 'unified'; import remarkPresetLintRecommended from 'remark-preset-lint-recommended'
✗ import remarkPresetLintRecommended from 'remark-preset-lint-recommended' as Preset
TypeScript users should import type separately; the preset has no exported types.
Shows how to set up and run the recommended lint preset on a Markdown string, reporting any lint issues.
import remarkParse from 'remark-parse'
import remarkPresetLintRecommended from 'remark-preset-lint-recommended'
import remarkStringify from 'remark-stringify'
import { unified } from 'unified'
import { reporter } from 'vfile-reporter'
const file = await unified()
.use(remarkParse)
.use(remarkPresetLintRecommended)
.use(remarkStringify)
.process('# Hello world\n\nThis is a test.')
if (file.messages.length > 0) {
console.error(reporter(file))
}
console.log(String(file))
Errors
Common errors & fixes
TypeError: remarkPresetLintRecommended is not a function
Incorrect import (named import instead of default) or trying to call the preset as a function without using .use().
fixUse default import: import remarkPresetLintRecommended from 'remark-preset-lint-recommended'. Then use with .use(remarkPresetLintRecommended).
Cannot find module 'remark-preset-lint-recommended'
Package not installed or used in a CommonJS environment with require().
fixInstall: npm install remark-preset-lint-recommended. If using CommonJS, transpile or update to ESM.
Error: Cannot find module 'remark-lint'
Missing peer dependency; remark-preset-lint-recommended requires remark-lint to be installed.
fixInstall remark-lint as a direct dependency: npm install remark-lint.
Audit
Dependencies
remark-lintrequiredCore linting engine required to run the preset.
remark-lint-final-newlinerequiredEnsures files end with a newline.
remark-lint-hard-break-spacesrequiredWarns about hard breaks that use too many spaces.
remark-lint-list-item-bullet-indentrequiredChecks bullet indentation in list items.
remark-lint-list-item-indentrequiredChecks list item indentation.
remark-lint-no-blockquote-without-markerrequiredWarns about blockquotes without a marker.
remark-lint-no-duplicate-definitionsrequiredWarns about duplicate definition identifiers.
remark-lint-no-heading-content-indentrequiredWarns about indented content in headings.
remark-lint-no-literal-urlsrequiredWarns about bare URLs not wrapped in angle brackets.
remark-lint-no-shortcut-reference-imagerequiredWarns about shortcut reference images.
remark-lint-no-shortcut-reference-linkrequiredWarns about shortcut reference links.
remark-lint-no-undefined-referencesrequiredWarns about references without definitions.
remark-lint-no-unused-definitionsrequiredWarns about definitions that are not used.
remark-lint-ordered-list-marker-stylerequiredChecks ordered list marker style.