Registry / testing / remark-preset-lint-recommended

remark-preset-lint-recommended

JSON →
library7.0.1jsnpmunverified

A preset for remark-lint that configures a set of recommended rules to catch common problems in markdown files. Current stable version is 7.0.1 (ESM-only, requires Node.js 16+). Part of the unified/remark ecosystem, it bundles 15+ lint rules including checks for final newline, hard break spaces, undefined references, and more. Differentiators: opinionated but minimal set of rules that aim to prevent mistakes and ensure cross-vendor compatibility; ships TypeScript types; actively maintained as part of the remark-lint monorepo.

npm install remark-preset-lint-recommended
INSTALL
IMPORT
SIG · REMARK-PRESET-LINT
R
remark-preset-lint-recommended
testingjavascriptv7.0.1
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.

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))
Debug
Known issues
breakingVersion 7 drops CommonJS support; package is ESM-only and requires Node.js 16+.
fix
Switch to ESM imports (import) and ensure Node >= 16.
affects: >=7.0.0
gotchaThe preset includes many sub-packaged remark-lint plugins; they are automatically installed but not individually configurable via the preset. To change plugin options, use the individual plugins directly.
fix
If you need to customize a rule, import the specific plugin (e.g., remark-lint-final-newline) and configure it separately.
affects: >=0.0.0
gotchaThe preset uses remark-lint ordered list marker style with '.' by default. This may conflict with some Markdown style guides that prefer ')'.
fix
Override by importing remark-lint-ordered-list-marker-style with the desired option: .use(remarkLintOrderedListMarkerStyle, ')').
affects: >=0.0.0
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().
fix
Use 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().
fix
Install: 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.
fix
Install remark-lint as a direct dependency: npm install remark-lint.
Upgrade
Version history
7.0.1latest on npm
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.
Agent activity
4 hits · last 30 days
node
4
Resources
remark-preset-lint-recommended — npm install remark-preset-lint-recommended · libregistry