ui-code-health-check
v1.0.5
Published
A package to perform a series of code quality checks including linting, testing, spell checking, TypeScript checking, and building.
Downloads
1,038
Readme
CH ✅
UI Code Health Check - a simple CLI helper tool that automates your project's key quality checks—linting, testing, TypeScript and spell checking, and building—with a single command. Instead of running each script separately, this tool executes your predefined scripts in order, saving you time and ensuring consistency across your workflow.
Features
- Linting: Checks code style with ESLint.
- Testing: Runs your test suite (e.g., Vitest).
- Spell Checking: Finds typos with cspell.
- Type Checking: Verifies types with TypeScript.
- Build: Runs your build process (e.g., Vite).
- Smart Skipping: Skips any missing scripts automatically.
Installation
Add this package as a dev dependency:
npm install --save-dev ui-code-health-check
# or
pnpm add -D ui-code-health-check
# or
yarn add -D ui-code-health-checkUsage
After installation, you can run the health check from your project root:
npx chOr add it as a script in your package.json (example):
{
"scripts": {
"your-script-name": "ch"
}
}How It Works
The tool checks your package.json for the following scripts and runs them in order if they exist:
linttestcspellts-chbuild
If a script is missing, that step is skipped.
Then run:
npm run <your-script-name>Example package.json
{
"scripts": {
"lint": "eslint .",
"test": "vitest run",
"cspell": "cspell \"src/**/*.{ts,tsx,md}\"",
"ts-ch": "npx tsc --noemit",
"build": "tsc && vite build"
}
}Note: The
cspellandts-chscripts are enforced by this tool and cannot be renamed or customized. Other scripts likelint,test, andbuildare chosen for compatibility with industry standards.
