| name | lint-and-pre-commit-checks |
| description | Use when establishing code quality automation. Lint = automatic style/error checking. Pre-commit = checks before commit.
|
Lint and Pre-commit Checks
Lint catches bugs and inconsistencies pre-commit. Husky + lint-staged + Prettier + ESLint = standard stack.
Standard lint stack
- Prettier — code formatting (consistent style)
- ESLint — JavaScript linting
- Stylelint — CSS linting
- Husky — git hooks
- lint-staged — only lint changed files
- TypeScript — type checking (if using TS)
Pre-commit setup
{
'husky': {
'hooks': {
'pre-commit': 'lint-staged'
}
},
'lint-staged': {
'*.{js,jsx,ts,tsx}': ['eslint --fix', 'prettier --write'],
'*.css': ['stylelint --fix', 'prettier --write'],
'*.{json,md}': ['prettier --write']
}
}
CI enforcement
GitHub Actions on PR:
name: Lint
on: [pull_request]
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm ci
- run: npm run lint
- run: npm run typecheck
Blocks merging if checks fail.
Where this fits in the X3 empire
Standard tooling for CardPrepAI code quality.