Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (code-quality-kit) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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-kit
This 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 โ kasunu2001@gmail.com