This document describes all code quality configuration files in the project and what they do.
- Overview
- Linting & Formatting
- Type Checking
- Unit Testing
- Spell Checking
- Shell Script Linting
- Editor Configuration
- IDE Integration
- Git Hooks (
.husky/) Workflow
Code quality tools enforce consistent standards, catch errors early, and maintain code maintainability. The project uses a layered approach combining linting, formatting, type checking, and spell checking to ensure all code meets quality standards before it reaches the repository.
| Tool | Configuration File | Purpose | Runs On |
|---|---|---|---|
| ESLint | eslint.config.ts |
Code linting | Commit, manually |
| ShellCheck | (none) | Shell script linting | Commit, manually |
| Markdownlint | .markdownlint.jsonc |
Markdown linting | Commit, manually |
| Prettier | prettier.config.ts |
Code formatting | Commit, manually |
| lint-staged | .lintstagedrc.json |
Staged file linting | Commit |
| TypeScript | tsconfig.json |
Type checking | Push, manually, IDE |
| CSpell | .cspell.jsonc |
Spell checking | Commit (via ESLint) |
| Bun Test | bunfig.toml |
Unit tests | Commit, CI/CD |
| Husky | .husky/ |
Git hooks | Commit, push |
These scripts offer granular control over local quality checks:
bun lint: Run all quality checks: TypeScript → ESLint → ShellCheckbun lint:fix: Auto-fix ESLint errors (TS, Markdown)bun lint:typescript: TypeScript type checking onlybun lint:eslint: ESLint only (TS, Markdown, YAML, .mdc)bun lint:markdown: Markdown linting onlybun lint:shellcheck: ShellCheck only (on Husky git hooks)bun test: Run unit tests
Automated checks run on every commit via Git hooks, providing immediate feedback. All tools can also be run manually for local development and CI/CD pipelines.
Purpose: ESLint configuration for code linting and quality checks.
What it does:
- Configures ESLint with TypeScript support using flat config format
- Integrates multiple ESLint plugins for comprehensive code quality
- Defines rules for TypeScript, JSON, HTML, YAML, Markdown, and
.mdcfiles - Lints Cursor AI rules in
.cursor/rules/*.mdcusing markdown processor - Uses unified config for TypeScript files
- Sets up ignores for build artifacts and generated files
Integrated ESLint Plugins:
@typescript-eslint/eslint-plugin- TypeScript linting and type-aware analysiseslint-plugin-sonarjs- Code quality and bug detection (includes cognitive complexity analysis)eslint-plugin-unicorn- JavaScript best practices and modern patterns@cspell/eslint-plugin- Spell checking (checks comments and strings)eslint-plugin-playwright- Playwright-specific rules and globals (applies to all TypeScript files)eslint-plugin-import- Import/export validation and orderingeslint-plugin-promise- Promise best practices and error handlingeslint-plugin-security- Security vulnerability detectioneslint-plugin-regexp- Regular expression pattern validationeslint-plugin-no-secrets- Secret detection in codeeslint-plugin-perfectionist- Code organization and sorting (complements import/order)eslint-plugin-yml- YAML linting for GitHub Actions workflows and config files@eslint/markdown- Official ESLint plugin for linting Markdown files (including.mdc)@eslint/json- Official ESLint plugin for linting JSON and JSONC files@html-eslint/eslint-plugin- HTML linting for template files
File-specific configurations apply different plugin sets to TypeScript, YAML, and Markdown files. See eslint.config.ts for details.
Purpose: Prettier configuration for automatic code formatting.
What it does:
- Sets formatting rules (semicolons, quotes, line width, etc.)
- Configures file-specific overrides (JSON files)
- Ensures consistent code style across the project
Purpose: Configures which files are linted/formatted on commit.
What it does:
- Runs ESLint and Prettier on staged
.tsfiles - Runs ESLint and Prettier on staged
.mdfiles - Runs ESLint and Prettier on staged
.jsonand.jsoncfiles - Runs ESLint and Prettier on staged
.ymlfiles - Runs ESLint and Prettier on staged
.htmlfiles - Runs Prettier on staged
.tomlfiles - Runs ShellCheck on staged
.husky/git hook files - Only processes files that are staged for commit (performance optimization)
- Enforces zero warnings (
--max-warnings=0) - fails on any ESLint warnings
Purpose: Markdownlint configuration for markdown file linting.
What it does:
- Configures markdownlint rules for consistent markdown formatting
- Enforces heading styles, list formatting, and blank line rules
- Validates link fragments and reference definitions
- Ensures code blocks have language specified
Purpose: TypeScript compiler configuration.
What it does:
- Configures TypeScript compilation options
- Enables strict type checking
- Sets module resolution and target
- Configures decorator support for playwright-bdd
- Defines includes/excludes for type checking
Run
bun lint:typescriptto verify types without building.
The project uses Bun's built-in test runner for unit testing utility functions. Unit tests achieve 100% code coverage for all utility modules in tests/utils/.
Test Structure:
- Test files: Located in
tests/unit/directory (*.test.tsfiles) - Configuration: The
bunfig.tomlfile is configured withroot = "tests/unit", which ensures that simply runningbun testonly executes unit tests, keeping them separate from the Playwright E2E suites - Coverage: Enabled by default via
bunfig.toml, reports function and line coverage - Coverage exclusions:
tests/utils/decorators.tsexcluded from coverage due to Bun's tooling limitations with decorators - Covered modules: All utility modules in
tests/utils/(attachments, browser-project, bug-reporter, decorators, environment, format, locators, network, pagination, random) and all scripts inscripts/(bump-version, changelog, lint, pin-versions, update-coverage-badge)
Running Tests:
# Run unit tests (bunfig.toml sets root = "tests/unit", so just "bun test" works)
bun testUnit tests are separate from E2E tests (Playwright). Unit tests focus on testing pure utility functions, while E2E tests validate end-to-end workflows.
Purpose: CSpell configuration for spell checking.
What it does:
- Configures dictionaries for multiple languages and domains
- Defines project-specific words (brand names, technical terms)
- Sets up regex patterns to ignore (URLs, selectors, etc.)
- Ignores build artifacts and node_modules
- Integrated with ESLint via
@cspell/eslint-plugin
Configured Dictionaries:
Includes standard dictionaries (en_US, typescript, node, npm, html, css) plus:
de-de- German language supportsoftware-terms- General software development terms
Project-specific words and regex patterns are defined in .cspell.jsonc.
Purpose: Static analysis and linting for shell scripts.
What it does:
- Lints all shell scripts in
.husky/directory (git hooks) - Catches common shell scripting errors and anti-patterns
- Validates shell syntax and best practices
- Provides warnings for potential bugs and security issues
- Automatically discovers all shell scripts (no hardcoded file list)
Scripts Checked:
.husky/pre-commit- Pre-commit quality checks.husky/commit-msg- Commit message validation.husky/prepare-commit-msg- Automatic version bumping.husky/pre-push- TypeScript type checking gate
ShellCheck runs as part of the main bun lint command alongside TypeScript and ESLint. Run bun lint:shellcheck to check shell scripts only.
Purpose: Editor configuration for consistent formatting.
What it does:
- Ensures consistent file formatting across editors
- Sets UTF-8 charset and LF line endings
- Configures 2-space indentation
- Trims trailing whitespace (except markdown files)
- Inserts final newline
- Works with most modern editors
Complements Prettier configuration.
Purpose: Git attributes for consistent file handling and line endings.
What it does:
- Ensures LF line endings for all text files (prevents CRLF issues)
- Auto-detects text files and normalizes line endings (
text=auto eol=lf) - Explicitly marks source code files as text (
.ts,.js,.json,.jsonc,.md) - Marks binary files appropriately (images, fonts) to prevent corruption
- Treats SVG files as text for version control
Works with EditorConfig to ensure consistent line endings across all environments and Git operations.
Code quality tools integrate with IDEs through workspace settings and extensions. For detailed editor setup and recommended extensions, see Editor Integration in the development documentation.
Husky enforces project quality gates at key stages of the Git workflow. These hooks work together to maintain code quality, enforce commit standards, and automate versioning.
| Hook Name | File | Trigger Event | Primary Action & Gate |
|---|---|---|---|
| Pre-Commit | .husky/pre-commit |
git commit |
Runs unit tests, updates coverage badge, and lint-staged (ESLint, Prettier, ShellCheck) on staged files |
| Commit-Msg | .husky/commit-msg |
Commit message saved | Validates Conventional Commits format |
| Prepare-Commit-Msg | .husky/prepare-commit-msg |
Before editor opens | Executes scripts to auto-bump version and generate changelog based on commit type |
| Pre-Push | .husky/pre-push |
git push |
Runs full TypeScript type checking (bun run lint:typescript) |
Purpose: The primary quality gate. Prevents commits with failing unit tests or immediate code quality issues.
Key Actions:
- Runs unit tests (
bun test) - Updates coverage badge in README.md (
bun scripts/update-coverage-badge.ts) - Runs lint-staged on staged files for fast, focused checks:
- ESLint + Prettier on
.ts,.mdfiles - Prettier on
.json,.yml,.html, etc. - ShellCheck on
.husky/git hook files
- ESLint + Prettier on
See
.husky/pre-commitfor the actual hook file. Requires Husky to be installed and configured. Seepackage.jsonpreparescript.
Purpose: Validates commit message format to ensure consistency and enable automated tooling.
Key Actions:
- Validates Conventional Commits format (
type(scope): subject) - Provides helpful error messages with examples
- Works with
.husky/pre-committo enforce commit standards
See
.husky/commit-msgfor the actual hook file. For commit guidelines and examples, see Commit Guidelines.
Purpose: Manages versioning and changelog updates automatically. This hook makes the project a self-versioning system.
Key Actions:
- Validates commit message format (must be Conventional Commits compliant)
- Skips processing for merge commits and reverts
- Executes
scripts/bump-version.tsto calculate the next semantic version based on commit type - Executes
scripts/changelog.tsto updateCHANGELOG.mdwith new entries - Stages updated
package.jsonandCHANGELOG.mdfiles - Only processes commits that follow Conventional Commits format (skips invalid formats)
Supporting Scripts:
scripts/bump-version.ts- Semantic version bumping logicscripts/changelog.ts- Changelog generation based on Conventional Commitsscripts/lint.ts- Unified linting: TypeScript → ESLint → ShellCheck with progress display
See
.husky/prepare-commit-msgfor the actual hook file. For version bumping details, see Automatic Version Bumping. No manual version management required - just follow Conventional Commits format.
Purpose: Final type safety gate before code reaches the remote repository.
Key Actions:
- Runs
bun run lint:typescriptbefore push - Catches type errors early
- Prevents pushing code with TypeScript errors
See
.husky/pre-pushfor the actual hook file. Complements pre-commit hooks by catching type errors before remote push.