Registry / testing / remark-lint-maximum-line-length

remark-lint-maximum-line-length

JSON →
library4.1.1jsnpmunverified

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.

npm install remark-lint-maximum-line-length
INSTALL
IMPORT
SIG · REMARK-LINT-MAXIMU
R
remark-lint-maximum-line-length
testingjavascriptv4.1.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.

remarkLintMaximumLineLength
✓ import remarkLintMaximumLineLength from 'remark-lint-maximum-line-length'
✗ const { remarkLintMaximumLineLength } = require('remark-lint-maximum-line-length')
Default export only. Use ESM import; CommonJS require is not supported because the package is ESM-only.
Options
✓ import type { Options } from 'remark-lint-maximum-line-length'
TypeScript type import for configuration options. Not available as a value.
remarkLintMaximumLineLength (CLI usage)
✓ remark --use remark-lint-maximum-line-length
✗ remark --use remarkLintMaximumLineLength
CLI plugin name is kebab-case, not camelCase.

Demonstrates linting a Markdown file with a maximum line length of 80, using the unified pipeline.

import { unified } from 'unified'; import remarkParse from 'remark-parse'; import remarkStringify from 'remark-stringify'; import remarkLint from 'remark-lint'; import remarkLintMaximumLineLength from 'remark-lint-maximum-line-length'; import { read } from 'to-vfile'; import { reporter } from 'vfile-reporter'; const file = await read('example.md'); const result = await unified() .use(remarkParse) .use(remarkLint) .use(remarkLintMaximumLineLength, { size: 80 }) .use(remarkStringify) .process(file); console.error(reporter(result));
remark --version
Debug
Known issues
breakingPackage is ESM-only since v3. CommonJS require() will throw an error.
fix
Use import statement instead of require(). If you must use CommonJS, use dynamic import() or stay on v2.x.
affects: >=3.0.0
breakingDefault options changed from size=80 to size=60 in v4.
fix
Explicitly set size option if you expect 80 characters.
affects: >=4.0.0
deprecatedThe option 'maxLineLength' was renamed to 'size' in v4.
fix
Use the 'size' option instead of 'maxLineLength'.
affects: >=4.0.0
gotchaThe rule ignores nodes that cannot be wrapped (e.g., code blocks, tables, long URLs). Users may expect warnings for all lines.
fix
No fix; this is by design. Review the documentation to understand which lines are checked.
affects: >=1.0.0
gotchaThe CLI plugin name must use kebab-case: 'remark-lint-maximum-line-length', not camelCase.
fix
Use the correct kebab-case name in CLI commands.
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'remark-lint-maximum-line-length'
Package not installed or incorrect import path.
fix
Run 'npm install remark-lint-maximum-line-length' and ensure you use the default import.
ERR_REQUIRE_ESM
Using require() on an ESM-only package.
fix
Change to import statement or use dynamic import().
TypeError: remarkLintMaximumLineLength is not a function
Using a named import instead of default import.
fix
Use 'import remarkLintMaximumLineLength from ...' (without braces).
TypeError: Cannot read properties of undefined (reading 'type')
Missing remark-parse or remark-lint plugin in the pipeline.
fix
Ensure you use remarkParse and remarkLint before the rule.
Upgrade
Version history
4.1.1latest on npm
Audit
Dependencies
unifiedrequiredRequired as a peer dependency; the lint rule is a unified plugin.
remark-lintrequiredRequires remark-lint to be preset; the rule is a sub-plugin of remark-lint.
remark-parseoptionalNeeded for parsing Markdown; typically used in the pipeline.
remark-stringifyoptionalNeeded for stringifying; used in the pipeline but optional if only linting.
Agent activity
2 hits · last 30 days
node
2
Resources
remark-lint-maximum-line-length — npm install remark-lint-maximum-line-length · libregistry