Registry / testing / remark-lint-linebreak-style

remark-lint-linebreak-style

JSON →
library4.0.1jsnpmunverified

remark-lint rule to warn when line endings (linebreaks) violate a given or detected style. Version 4.0.1 is the current stable release. It is part of the remark-lint ecosystem and is ESM-only (Node.js 16+). Provides configurable detection of consistent line endings (unix LF or windows CRLF) and can auto-detect the first used style. Ships TypeScript type definitions. Ideal for ensuring consistent line endings across markdown files.

npm install remark-lint-linebreak-style
INSTALL
IMPORT
SIG · REMARK-LINT-LINEBR
R
remark-lint-linebreak-style
testingjavascriptv4.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.

remarkLintLinebreakStyle
import remarkLintLinebreakStyle from 'remark-lint-linebreak-style'
const remarkLintLinebreakStyle = require('remark-lint-linebreak-style')
Package is ESM-only. CommonJS require will fail.
Options (type)
import type { Options } from 'remark-lint-linebreak-style'
TypeScript type import for configuration options.
Style (type)
import type { Style } from 'remark-lint-linebreak-style'
TypeScript type for 'unix' or 'windows'.

Lints a markdown file for consistent unix line endings using remark-lint and this plugin. Ensure 'example.md' exists.

import remarkLint from 'remark-lint' import remarkLintLinebreakStyle from 'remark-lint-linebreak-style' import remarkParse from 'remark-parse' import remarkStringify from 'remark-stringify' import {read} from 'to-vfile' import {unified} from 'unified' import {reporter} from 'vfile-reporter' const file = await read('example.md') await unified() .use(remarkParse) .use(remarkLint) .use(remarkLintLinebreakStyle, 'unix') .use(remarkStringify) .process(file) console.error(reporter(file))
Debug
Known issues
breakingVersion 4+ is ESM-only; CommonJS require() will throw.
fix
Switch to import syntax or use dynamic import().
affects: >=4.0.0
deprecatedNo deprecated versions known.
gotchaThe 'consistent' option auto-detects the first line ending and warns on subsequent mismatches. It does not enforce a specific style.
fix
Use 'unix' or 'windows' explicitly if consistent enforcement is needed.
affects: >=1.0.0
gotcharemark-stringify always outputs Unix line endings (LF), regardless of the lint configuration. This plugin only warns, it does not fix.
fix
Use a separate tool (e.g., text editor settings) to enforce final output line endings.
affects: >=1.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module
Package is ESM-only; CommonJS require() is used.
fix
Replace require() with import statement, or use dynamic import().
TypeError: Cannot read properties of undefined (reading 'type')
Plugin used without first configuring remark-lint or missing remarkParse/remarkStringify.
fix
Ensure unified().use(remarkParse).use(remarkLint).use(...) chain is correct.
Upgrade
Version history
4.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
remark-lint-linebreak-style — npm install remark-lint-linebreak-style · libregistry