No one sees whitespace bugs—until now, with this CLI tool

Pull requests that bloat with phantom trailing spaces, shell scripts that break in CI because of rogue CRLF endings, or a .env file whose first variable vanishes under a UTF-8 BOM—these are the invisible gremlins that turn small changes into endless diff noise. Until today, spotting them meant stitching together three or four separate linters and hooks. Now there’s wssweep: a single zero-config command that finds seven common whitespace problems and can repair them in place.
One command, seven checks
Running npx wssweep src/app.js scans a file for trailing whitespace, mixed line endings, lone carriage returns, missing final newlines, extra trailing blank lines, UTF-8 BOM bytes, and mixed indentation. A quick --fix flag applies the cleanups and exits with a non-zero code if anything was altered—perfect for CI gates. The same behavior is available via pip install wssweep in Python, producing byte-for-byte identical reports and fixes across both runtimes.
Why existing tools fall short
Most utilities focus on a slice of the problem. Editorconfig-checker can report but can’t fix without an .editorconfig file. Pre-commit’s trailing-whitespace, end-of-file-fixer, and mixed-line-ending hooks only work inside the pre-commit framework and can’t be run ad-hoc. Prettier reformats code but ignores files it can’t parse. Dos2unix only handles line endings. Wssweep combines all seven checks into one command and drops into any pipeline without configuration or framework lock-in.
Sensible defaults, no surprises
Because a zero-config tool must make the right calls by default, wssweep flags only mixed CRLF/LF line endings, keeps CRLF in .bat/.cmd files intact, and skips the trailing-whitespace check in Markdown to preserve hard line breaks. Mixed indentation is reported but not changed—guessing tab width risks silently wrecking alignment. Under the hood, the tool avoids platform-specific quirks by processing raw bytes in a latin-1 view, ensuring Node and Python builds agree on every byte when --fix is used.
Source: DEV Community. AI-assisted editorial synthesis — TechnoExpress.

