Code Quality Suite

Code Quality Generators

Generate battle-tested configurations for Git hooks, linters, and formatters. Eliminate code review arguments and catch bugs before they reach CI.

Code Quality Best Practices

  • 1

    Run heavy tests in CI or pre-push, not in pre-commit hooks, to preserve developer speed.

  • 2

    Integrate eslint-config-prettier to prevent ESLint rules from fighting Prettier's formatting.

  • 3

    Never bypass pre-commit hooks (git commit --no-verify) unless absolutely critical in an emergency.

  • 4

    Ensure Husky scripts have executable permissions (chmod +x) when shared across macOS and Linux teams.

  • 5

    Use Conventional Commits to automate your changelogs and ensure semantic versioning accuracy.

Frequently Asked Questions

Why should I use ESLint and Prettier together?
ESLint and Prettier serve different purposes. ESLint is a code-quality tool that analyzes your logic for potential bugs (like unused variables or unsafe types). Prettier is a code-formatting tool that enforces a consistent visual style (like line width and quotes). Using them together with `eslint-config-prettier` gives you the best of both worlds without conflicting rules.
What is Husky and why do I need Git hooks?
Husky is a tool that makes managing Git hooks incredibly simple. By configuring hooks like `pre-commit` or `commit-msg`, you can automatically run linters or tests right before a developer commits code. This acts as the first line of defense in your quality gates, preventing broken or unformatted code from ever leaving a developer's machine.
How does lint-staged improve pre-commit performance?
Running `eslint .` across an entire enterprise monorepo during a pre-commit hook can take minutes, severely degrading developer experience. Lint-staged solves this by exclusively running your linters and formatters on the files that are currently staged in Git, turning a 2-minute check into a 2-second check.
What are Conventional Commits?
Conventional Commits is a lightweight convention on top of commit messages (e.g., `feat: added login`, `fix: header alignment`). By strictly enforcing this format using Commitlint, you can completely automate your semantic versioning (SemVer) bumps and changelog generation using tools like Semantic Release or Changesets.