code-quality-kit
v1.0.10
Published
Reusable code quality configuration toolkit with ESLint, Prettier, Husky, Commitlint, GitHub Actions, and editor config support.
Maintainers
Readme
🔧 Code Quality Kit
This Code Quality Kit provides a plug-and-play setup to enforce consistent code quality across projects using:
- ✅ Prettier – Code formatting
- ✅ ESLint – Linting with Prettier integration
- ✅ Husky – Git hooks
- ✅ Lint-Staged – Only run formatters on staged files
- ✅ Commitlint – Enforce conventional commits
- ✅ GitHub Actions – CI for quality checks
📦 Installation
1. Install the Kit
npm install --save-dev code-quality-kit🚀 Setup
Run the provided setup script:
npx code-quality-kitThis will:
- Create config files
- Set up Husky pre-commit & commit-msg hooks
- Add GitHub Actions CI workflow
- Enable Prettier + ESLint + Commitlint
⚙️ Configuration
Customize features by adding a .codequalityrc.json file in your project root:
{
"husky": true,
"eslint": true,
"prettier": true,
"commitlint": true,
"ci": true
}You can turn off any part of the setup by setting its value to false.
🧪 Pre-commit Hook
The pre-commit hook runs:
- ✅ Prettier formatting (
npx prettier --write .) - ✅ ESLint autofix (
npx eslint . --fix) - ✅ Lint-staged for staged files only
🧪 Commit-msg Hook
Ensures commit messages follow Conventional Commits:
npx commitlint --edit $1✅ GitHub Actions – Quality Check
Automatically runs formatting and linting checks on push and pull request:
.github/workflows/quality-check.yml💻 Recommended VS Code Extensions
To get real-time linting and formatting feedback in your editor:
| Extension | Description |
| --------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- |
| ESLint | Integrates ESLint into VS Code |
| Prettier - Code formatter | Automatically format code |
| Conventional Commits (optional) | Helps write conventional commit messages |
| EditorConfig for VS Code | Respects .editorconfig rules |
📁 Output Files
The following files will be created or updated:
.prettierrc.js
.eslintrc.js
commitlint.config.js
lint-staged.config.js
.husky/pre-commit
.husky/commit-msg
.github/workflows/quality-check.yml👥 Author
Kasun Udara – [email protected]
