tz-clean
v2.6.0
Published
A global command-line utility to enforce consistent code quality across your projects. It formats, lints, strips comments, and typechecks your code — step by step, with live progress.
Readme
tz-clean
A global command-line utility to enforce consistent code quality across your projects. It formats, lints, strips comments, and typechecks your code — step by step, with live progress.
Features
- Prettier — Formats all supported files for consistent styling.
- Strip Comments — Removes leftover comments from source files.
- Typecheck — Runs
tsc --noEmitto catch type errors. - ESLint — Runs each plugin as a separate step with a live spinner:
- ESLint Core — basic JS rules
- TypeScript ESLint — naming conventions and TS-specific rules
- SonarJS — code quality and cognitive complexity
- Perfectionist — import and key ordering (opt-in:
--perfectionist) - No-Comments — disallows leftover comments (opt-in:
--no-comments) - Project Structure — enforces folder/file structure conventions
- Test — Runs the test suite via Vitest (opt-in:
--test) - Cruise — Checks dependency/architecture rules (opt-in:
--cruise) - Spellcheck — Catches typos in code and strings (opt-in:
--spellcheck)
Every ESLint sub-step can be individually toggled via CLI args, so you can skip the slow ones when you just need a quick check.
Quick Start
npm install -g tz-clean
tz-cleanCommon Usage
# Skip the slowest step
tz-clean --no-sonar
# Only lint, skip everything else
tz-clean --no-prettier --no-strip-comments --no-typecheck
# Analyze a specific folder only
tz-clean --include src
# Fast run — core JS lint only
tz-clean --no-prettier --no-strip-comments --no-typecheck --no-typescript --no-sonar --no-project-structure
# Include ordering checks (Perfectionist, opt-in)
tz-clean --perfectionistDocumentation
- User Guide — Full list of args, flags, and usage examples.
- Developer Guide — Local testing, contributing, and publishing.
