{"id":26292,"library":"remark-preset-lint-consistent","title":"remark-preset-lint-consistent","description":"remark preset that configures remark-lint rules to enforce consistency in Markdown style, such as blockquote indentation, emphasis marker, heading style, list marker style, and table cell padding. Current stable version is 6.0.1. Part of the remark-lint monorepo, released on npm with ESM-only support since v4. Key differentiator: it provides a zero-config preset for consistent Markdown formatting, complementing other presets like remark-preset-lint-recommended and remark-preset-lint-markdown-style-guide. Actively maintained by the unified collective.","status":"active","version":"6.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/remarkjs/remark-lint#main","tags":["javascript","consistency","consistent","preset","remark","remark-lint","remark-preset","typescript"],"install":[{"cmd":"npm install remark-preset-lint-consistent","lang":"bash","label":"npm"},{"cmd":"yarn add remark-preset-lint-consistent","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-preset-lint-consistent","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Base linting engine","package":"remark-lint","optional":false},{"reason":"Required to process Markdown with remark plugins","package":"unified","optional":false}],"imports":[{"note":"ESM-only since v4; CommonJS require() throws ERR_REQUIRE_ESM.","wrong":"const remarkPresetLintConsistent = require('remark-preset-lint-consistent')","symbol":"remarkPresetLintConsistent","correct":"import remarkPresetLintConsistent from 'remark-preset-lint-consistent'"},{"note":"This package has a default export only, not a named export.","wrong":"import { remarkPresetLintConsistent } from 'remark-preset-lint-consistent'","symbol":"default","correct":"import remarkPresetLintConsistent from 'remark-preset-lint-consistent'"},{"note":"TypeScript users should use the default export type via `typeof import('remark-preset-lint-consistent')` or use a type assertion.","wrong":"import { remarkPresetLintConsistent } from 'remark-preset-lint-consistent'","symbol":"type remarkPresetLintConsistent","correct":"import type { default as remarkPresetLintConsistent } from 'remark-preset-lint-consistent'"}],"quickstart":{"code":"import { unified } from 'unified';\nimport remarkParse from 'remark-parse';\nimport remarkStringify from 'remark-stringify';\nimport remarkPresetLintConsistent from 'remark-preset-lint-consistent';\nimport { reporter } from 'vfile-reporter';\nimport { read } from 'to-vfile';\n\nconst file = await read('example.md');\nawait unified()\n  .use(remarkParse)\n  .use(remarkPresetLintConsistent)\n  .use(remarkStringify)\n  .process(file);\n\nconsole.error(reporter(file));\n// If there are consistency issues, they will be reported.\n","lang":"typescript","description":"Process a Markdown file with the preset to check for consistency issues and report them."},"warnings":[{"fix":"Switch to ESM imports and ensure Node.js version >=16.","message":"remark-preset-lint-consistent v4 dropped support for CommonJS (require). Packages are now ESM-only.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"To enforce a specific style, use individual remark-lint rules with explicit options instead of the preset.","message":"The preset uses 'consistent' as the default option for most rules, which may not match your project's current style. It warns about inconsistencies, not a specific style.","severity":"gotcha","affected_versions":"*"},{"fix":"Always pin exact versions of remark-lint packages to avoid unexpected warnings.","message":"Some underlying rules like remark-lint-table-cell-padding will be updated in future versions; check compatibility when upgrading.","severity":"deprecated","affected_versions":"*"},{"fix":"Ensure remark-lint is in your dependencies: npm install remark-lint","message":"The preset requires remark-lint to be installed as a peer dependency, but it is not automatically installed. Missing peerDependency can cause runtime errors.","severity":"gotcha","affected_versions":"*"},{"fix":"Use the preset as a unified plugin: .use(remarkPresetLintConsistent) without additional configuration.","message":"In v5, the internal structure changed: all rules now export a function that must be used with unified().use(). If you were passing options in a different way, it may break.","severity":"breaking","affected_versions":">=5.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Convert your project to ESM (add 'type': 'module' to package.json) or use dynamic import: const m = await import('remark-preset-lint-consistent');","cause":"Using CommonJS require() with an ESM-only package (v4+).","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/node_modules/remark-preset-lint-consistent/index.js from /path/to/your-file.js not supported."},{"fix":"Use default import: import remarkPresetLintConsistent from 'remark-preset-lint-consistent'; then .use(remarkPresetLintConsistent)","cause":"Importing the preset incorrectly (e.g., using named import) or forgetting to add it to unified().use().","error":"TypeError: remarkPresetLintConsistent is not a function"},{"fix":"Run: npm install remark-lint","cause":"remark-lint is not installed.","error":"Missing required peer dependency: remark-lint"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}