A package to perform a series of code quality checks including linting, testing, spell checking, TypeScript checking, and building.
npm install ui-code-health-checkUI 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.
- Installation
- Usage
- How It Works
- Example package.json
- 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.
Add this package as a dev dependency:
``bash`
npm install --save-dev ui-code-health-checkor
pnpm add -D ui-code-health-checkor
yarn add -D ui-code-health-check
After installation, you can run the health check from your project root:
`bash`
npx ch
Or add it as a script in your package.json (example):
`json`
{
"scripts": {
"your-script-name": "ch"
}
}
The tool checks your package.json for the following scripts and runs them in order if they exist:
1. linttest
2. cspell
3. ts-ch
4. build
5.
If a script is missing, that step is skipped.
Then run:
`bash`
npm run
`json`
{
"scripts": {
"lint": "eslint .",
"test": "vitest run",
"cspell": "cspell \"src/*/.{ts,tsx,md}\"",
"ts-ch": "npx tsc --noemit",
"build": "tsc && vite build"
}
}
> Note:
> The cspell and ts-ch scripts are enforced by this tool and cannot be renamed or customized.lint
> Other scripts like , test, and build` are chosen for compatibility with industry standards.