This document provides an overview of the automated code quality tools in the TypeScript repository. These tools enforce code style, detect code issues, identify unused code, measure test coverage, and scan for security vulnerabilities. Together they ensure code consistency, maintainability, and security before code reaches production.
For specific details about each system's configuration and usage, see:
For information about how these tools are integrated into the CI pipeline, see Main CI Pipeline.
The TypeScript repository enforces code quality through six automated tools that run in CI and are available locally:
| Tool | Purpose | Configuration | CI Job |
|---|---|---|---|
| dprint | Code formatting for TypeScript, JSON, YAML | .dprint.jsonc | format |
| ESLint | Code linting with type-aware and custom rules | eslint.config.mjs, scripts/eslint/rules/ | lint |
| knip | Dead code and unused export detection | knip.jsonc | knip |
| c8 | Test coverage measurement | .c8rc.json | coverage |
| CodeQL | Static security analysis | .github/codeql/codeql-configuration.yml | CodeQL-Build |
| Scorecard | Supply-chain security assessment | N/A (action-based) | analysis |
The format, lint, and knip jobs are blocking CI checks that must pass before code can be merged. The coverage job is informational. CodeQL and Scorecard run in separate workflows but contribute to security monitoring.
Sources: .dprint.jsonc1-61 eslint.config.mjs1-20 knip.jsonc1-38 .c8rc.json1-8 .github/workflows/ci.yml166-211 .github/workflows/codeql.yml1-74 .github/workflows/scorecard.yml1-60
The following diagram maps CI jobs to their respective tools, configuration files, and reporting destinations.
Code Quality Systems — CI Jobs, Tools, and Config Files
Sources: .github/workflows/ci.yml166-211 .github/workflows/codeql.yml1-74 .github/workflows/scorecard.yml1-60 .dprint.jsonc1-61 eslint.config.mjs1-20 knip.jsonc1-38 .c8rc.json1-8
ESLint provides code linting using typescript-eslint and a set of repository-specific custom rules. These rules enforce patterns such as argument-trivia.cjs for boolean parameters and jsdoc-format.cjs for internal documentation consistency.
For details, see ESLint Configuration.
Sources: eslint.config.mjs1-20 scripts/eslint/rules/argument-trivia.cjs1-10 scripts/eslint/rules/jsdoc-format.cjs1-10
dprint is the primary formatter for TypeScript, JSON, and YAML files. It is configured in .dprint.jsonc and uses WASM-based plugins for high-performance formatting.
For details, see Code Formatting.
Sources: .dprint.jsonc1-61 package.json99
knip is used to find unused files, dependencies, and exports. It is configured to recognize the project's entry points like src/tsc/tsc.ts and src/tsserver/server.ts.
Sources: knip.jsonc1-38 .github/workflows/ci.yml179-191
Test coverage is measured using c8, which utilizes the V8 engine's native coverage capabilities. Reports are generated in several formats (LCOV, Cobertura, and a custom Codecov JSON) and uploaded to Codecov.
For details, see Code Coverage.
Sources: .c8rc.json1-8 .github/workflows/ci.yml132-165
Static analysis is performed by CodeQL, which scans for common vulnerabilities. Supply-chain security is monitored via the OpenSSF Scorecard.
For details, see Security Scanning.
Sources: .github/workflows/codeql.yml1-74 .github/workflows/scorecard.yml1-60
The following diagram illustrates how these tools are invoked during local development and within the GitHub Actions CI environment.
Code Quality Tool Execution Flow
Sources: package.json88-101 Herebyfile.mjs559-577 .github/workflows/ci.yml166-211