Registry / testing / remark-lint-no-trailing-spaces

remark-lint-no-trailing-spaces

JSON →
library4.0.3jsnpmunverified

A remark-lint external rule that warns when lines end with trailing spaces or tabs. Current stable version: 4.0.3. Released as a standalone package, it integrates with the remark-lint ecosystem for linting Markdown. Simple and focused: only checks for trailing whitespace, no configuration options. Differentiates from similar rules by being an external rule from the unified collective, maintained separately. Release cadence is irregular.

npm install remark-lint-no-trailing-spaces
INSTALL
IMPORT
SIG · REMARK-LINT-NO-TRA
R
remark-lint-no-trailing-spaces
testingjavascriptv4.0.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.

noTrailingSpaces
import noTrailingSpaces from 'remark-lint-no-trailing-spaces'
const { noTrailingSpaces } = require('remark-lint-no-trailing-spaces')
Default export; requires ESM or unified configuration. CommonJS require('remark-lint-no-trailing-spaces').default is also possible but not recommended.
remarkLintNoTrailingSpaces
import remarkLintNoTrailingSpaces from 'remark-lint-no-trailing-spaces'
import { remarkLintNoTrailingSpaces } from 'remark-lint-no-trailing-spaces'
Default export can be imported under any name; common to use 'noTrailingSpaces'.
rule
import noTrailingSpaces from 'remark-lint-no-trailing-spaces'
import { rule as noTrailingSpaces } from 'remark-lint-no-trailing-spaces'
Not a named export; rule is attached to the default export as a property.

Shows how to use the rule with remark-lint to detect trailing spaces in a Markdown document.

import { remark } from 'remark'; import lint from 'remark-lint'; import noTrailingSpaces from 'remark-lint-no-trailing-spaces'; const file = await remark() .use(lint) .use(noTrailingSpaces) .process('# Title \nHello world!'); console.log(file.messages); // Output: [1:8-1:9 warning Remove trailing spaces no-trailing-spaces remark-lint]
remark --version
Debug
Known issues
breakingVersion 4.0.0 drops support for Node.js < 18.
fix
Upgrade Node.js to version 18 or later.
affects: >=4.0.0
breakingVersion 4.0.0 switches to ESM-only; CommonJS require() will not work without .default property.
fix
Use import statement or const noTrailingSpaces = require('remark-lint-no-trailing-spaces').default.
affects: >=4.0.0
deprecatedAs of v3, the package is still CJS compatible.
fix
No action needed; but consider migrating to ESM for future compatibility.
affects: <4.0.0
gotchaThis rule only lints for trailing spaces and tabs; it does not check for trailing newlines or other whitespace issues.
fix
Use additional remark-lint rules like remark-lint-no-consecutive-blank-lines or remark-lint-final-newline for related checks.
affects: all
Errors
Common errors & fixes
Cannot find module 'remark-lint-no-trailing-spaces'
Package not installed or import path incorrect.
fix
npm install remark-lint-no-trailing-spaces
TypeError: noTrailingSpaces is not a function
Using ES import in a CommonJS environment without default handling.
fix
Use: const noTrailingSpaces = require('remark-lint-no-trailing-spaces').default; OR switch to ESM.
Error: Cannot find module 'remark-lint'
remark-lint peer dependency not installed.
fix
npm install remark-lint
Upgrade
Version history
4.0.3latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
6
OpenAI (training)
2
Resources
remark-lint-no-trailing-spaces — npm install remark-lint-no-trailing-spaces · libregistry