{"id":26273,"library":"remark-lint-no-trailing-spaces","title":"remark-lint-no-trailing-spaces","description":"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.","status":"active","version":"4.0.3","language":"javascript","source_language":"en","source_url":"https://github.com/Trott/remark-lint-no-trailing-spaces","tags":["javascript","remark","lint","rule","trailing","spaces","whitespaces"],"install":[{"cmd":"npm install remark-lint-no-trailing-spaces","lang":"bash","label":"npm"},{"cmd":"yarn add remark-lint-no-trailing-spaces","lang":"bash","label":"yarn"},{"cmd":"pnpm add remark-lint-no-trailing-spaces","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Default export; requires ESM or unified configuration. CommonJS require('remark-lint-no-trailing-spaces').default is also possible but not recommended.","wrong":"const { noTrailingSpaces } = require('remark-lint-no-trailing-spaces')","symbol":"noTrailingSpaces","correct":"import noTrailingSpaces from 'remark-lint-no-trailing-spaces'"},{"note":"Default export can be imported under any name; common to use 'noTrailingSpaces'.","wrong":"import { remarkLintNoTrailingSpaces } from 'remark-lint-no-trailing-spaces'","symbol":"remarkLintNoTrailingSpaces","correct":"import remarkLintNoTrailingSpaces from 'remark-lint-no-trailing-spaces'"},{"note":"Not a named export; rule is attached to the default export as a property.","wrong":"import { rule as noTrailingSpaces } from 'remark-lint-no-trailing-spaces'","symbol":"rule","correct":"import noTrailingSpaces from 'remark-lint-no-trailing-spaces'"}],"quickstart":{"code":"import { remark } from 'remark';\nimport lint from 'remark-lint';\nimport noTrailingSpaces from 'remark-lint-no-trailing-spaces';\n\nconst file = await remark()\n  .use(lint)\n  .use(noTrailingSpaces)\n  .process('# Title  \\nHello world!');\n\nconsole.log(file.messages);\n// Output: [1:8-1:9 warning Remove trailing spaces no-trailing-spaces remark-lint]","lang":"javascript","description":"Shows how to use the rule with remark-lint to detect trailing spaces in a Markdown document."},"warnings":[{"fix":"Upgrade Node.js to version 18 or later.","message":"Version 4.0.0 drops support for Node.js < 18.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Use import statement or const noTrailingSpaces = require('remark-lint-no-trailing-spaces').default.","message":"Version 4.0.0 switches to ESM-only; CommonJS require() will not work without .default property.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"No action needed; but consider migrating to ESM for future compatibility.","message":"As of v3, the package is still CJS compatible.","severity":"deprecated","affected_versions":"<4.0.0"},{"fix":"Use additional remark-lint rules like remark-lint-no-consecutive-blank-lines or remark-lint-final-newline for related checks.","message":"This rule only lints for trailing spaces and tabs; it does not check for trailing newlines or other whitespace issues.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"npm install remark-lint-no-trailing-spaces","cause":"Package not installed or import path incorrect.","error":"Cannot find module 'remark-lint-no-trailing-spaces'"},{"fix":"Use: const noTrailingSpaces = require('remark-lint-no-trailing-spaces').default; OR switch to ESM.","cause":"Using ES import in a CommonJS environment without default handling.","error":"TypeError: noTrailingSpaces is not a function"},{"fix":"npm install remark-lint","cause":"remark-lint peer dependency not installed.","error":"Error: Cannot find module 'remark-lint'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}