{"id":26232,"library":"remark-lint-maximum-line-length","title":"remark-lint-maximum-line-length","description":"A remark-lint rule that warns when lines in Markdown files exceed a configurable maximum length. Version 4.1.1 is the current stable release, part of the remark-lint monorepo. It is ESM-only, requires Node.js 16+, and ships TypeScript types. Unlike general linters, it respects Markdown node types (e.g., ignores code blocks, tables, and long URLs/links that cannot be wrapped). Supports a custom stringLength function for accurate character width measurement. Active development, updated regularly with other remark-lint packages.","status":"active","version":"4.1.1","language":"javascript","source_language":"en","source_url":"https://github.com/remarkjs/remark-lint#main","tags":["javascript","length","line","lint","remark","remark-lint","remark-lint-rule","rule","typescript"],"install":[{"cmd":"npm install remark-lint-maximum-line-length","lang":"bash","label":"npm"},{"cmd":"yarn add remark-lint-maximum-line-length","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-lint-maximum-line-length","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required as a peer dependency; the lint rule is a unified plugin.","package":"unified","optional":false},{"reason":"Requires remark-lint to be preset; the rule is a sub-plugin of remark-lint.","package":"remark-lint","optional":false},{"reason":"Needed for parsing Markdown; typically used in the pipeline.","package":"remark-parse","optional":true},{"reason":"Needed for stringifying; used in the pipeline but optional if only linting.","package":"remark-stringify","optional":true}],"imports":[{"note":"Default export only. Use ESM import; CommonJS require is not supported because the package is ESM-only.","wrong":"const { remarkLintMaximumLineLength } = require('remark-lint-maximum-line-length')","symbol":"remarkLintMaximumLineLength","correct":"import remarkLintMaximumLineLength from 'remark-lint-maximum-line-length'"},{"note":"TypeScript type import for configuration options. Not available as a value.","symbol":"Options","correct":"import type { Options } from 'remark-lint-maximum-line-length'"},{"note":"CLI plugin name is kebab-case, not camelCase.","wrong":"remark --use remarkLintMaximumLineLength","symbol":"remarkLintMaximumLineLength (CLI usage)","correct":"remark --use remark-lint-maximum-line-length"}],"quickstart":{"code":"import { unified } from 'unified';\nimport remarkParse from 'remark-parse';\nimport remarkStringify from 'remark-stringify';\nimport remarkLint from 'remark-lint';\nimport remarkLintMaximumLineLength from 'remark-lint-maximum-line-length';\nimport { read } from 'to-vfile';\nimport { reporter } from 'vfile-reporter';\n\nconst file = await read('example.md');\n\nconst result = await unified()\n  .use(remarkParse)\n  .use(remarkLint)\n  .use(remarkLintMaximumLineLength, { size: 80 })\n  .use(remarkStringify)\n  .process(file);\n\nconsole.error(reporter(result));","lang":"typescript","description":"Demonstrates linting a Markdown file with a maximum line length of 80, using the unified pipeline."},"warnings":[{"fix":"Use import statement instead of require(). If you must use CommonJS, use dynamic import() or stay on v2.x.","message":"Package is ESM-only since v3. CommonJS require() will throw an error.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Explicitly set size option if you expect 80 characters.","message":"Default options changed from size=80 to size=60 in v4.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Use the 'size' option instead of 'maxLineLength'.","message":"The option 'maxLineLength' was renamed to 'size' in v4.","severity":"deprecated","affected_versions":">=4.0.0"},{"fix":"No fix; this is by design. Review the documentation to understand which lines are checked.","message":"The rule ignores nodes that cannot be wrapped (e.g., code blocks, tables, long URLs). Users may expect warnings for all lines.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use the correct kebab-case name in CLI commands.","message":"The CLI plugin name must use kebab-case: 'remark-lint-maximum-line-length', not camelCase.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install remark-lint-maximum-line-length' and ensure you use the default import.","cause":"Package not installed or incorrect import path.","error":"Cannot find module 'remark-lint-maximum-line-length'"},{"fix":"Change to import statement or use dynamic import().","cause":"Using require() on an ESM-only package.","error":"ERR_REQUIRE_ESM"},{"fix":"Use 'import remarkLintMaximumLineLength from ...' (without braces).","cause":"Using a named import instead of default import.","error":"TypeError: remarkLintMaximumLineLength is not a function"},{"fix":"Ensure you use remarkParse and remarkLint before the rule.","cause":"Missing remark-parse or remark-lint plugin in the pipeline.","error":"TypeError: Cannot read properties of undefined (reading 'type')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}