Registry / testing / remark-lint-no-long-code

remark-lint-no-long-code

JSON →
library0.1.3jsnpmunverified

remark lint plugin that warns when any line inside a code block exceeds a configured maximum length. Current stable version is 0.1.3. Released as part of the remark-lint-plugins monorepo. Provides options to set line length (default 100), exclude certain code block languages, and configure tab width. Differentiates from other linting rules by focusing specifically on code block content rather than inline code or prose, and by offering per-language exclusions.

npm install remark-lint-no-long-code
INSTALL
IMPORT
SIG · REMARK-LINT-NO-LON
R
remark-lint-no-long-code
testingjavascriptv0.1.3
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.

default (plugin)
import remarkLintNoLongCode from 'remark-lint-no-long-code'
const remarkLintNoLongCode = require('remark-lint-no-long-code')
CommonJS require works but ESM import is preferred for modern projects.
remark-lint-no-long-code (plugin name)
["remark-lint-no-long-code", { length: 100 }]
["remark-lint-no-long-code", 100]
Options must be an object, not a scalar. Incorrect usage will silently fail.
TypeScript types
import type { Plugin } from 'unified'; const plugin: Plugin = remarkLintNoLongCode
import remarkLintNoLongCode from 'remark-lint-no-long-code/types'
Type definitions are bundled in the package. No separate type import needed.

Shows how to use remark lint with no-long-code plugin, configuring max length, exclusions, and tab width.

import { remark } from 'remark'; import remarkLint from 'remark-lint'; import remarkLintNoLongCode from 'remark-lint-no-long-code'; import remarkPresetLintConsistent from 'remark-preset-lint-consistent'; import { readSync } from 'to-vfile'; import { reporter } from 'vfile-reporter'; const file = readSync('./readme.md'); const result = await remark() .use(remarkLint) .use(remarkLintNoLongCode, { length: 100, exclude: ['dot', 'smali'], tabWidth: 4 }) .process(file); console.error(reporter(result));
Debug
Known issues
gotchaOptions must be provided as an object (e.g., { length: 100 }), not as a scalar. Passing a number directly will be ignored and defaults will apply.
fix
Use ["remark-lint-no-long-code", { length: 100 }] in config or .use(plugin, { length: 100 }) in code.
affects: all
gotchaThe plugin only checks code blocks, not inline code. Inline code lines are not subject to length validation.
fix
Ensure expectations match: use other linting rules for inline code if needed.
affects: all
deprecatedThe package is still in early development (v0.1.3). API may change before 1.0.0.
fix
Pin to exact version or review release notes before upgrading.
affects: <1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'remark-lint-no-long-code'
Package not installed or not in node_modules.
fix
Run `npm install remark-lint-no-long-code` and ensure it's in dependencies.
Warning: Plugin 'remark-lint-no-long-code' did not have options applied correctly. Check configuration.
Options passed as scalar instead of object, or configuration syntax incorrect.
fix
Use object form: ["remark-lint-no-long-code", { length: 100 }].
TypeError: Cannot read properties of undefined (reading 'length')
Plugin executed without being preceded by remark-lint. The lint plugin must be registered after remark-lint.
fix
Add `.use(remarkLint)` before `.use(remarkLintNoLongCode)` in your remark pipeline.
Upgrade
Version history
0.1.3latest on npm
Audit
Dependencies
remark-lintrequiredrequired to integrate with remark linting framework
Agent activity
4 hits · last 30 days
node
4
Resources
remark-lint-no-long-code — npm install remark-lint-no-long-code · libregistry