Implementation:Cypress io Cypress Type Check and Lint
Appearance
| Knowledge Sources | |
|---|---|
| Domains | Development, Quality_Assurance |
| Last Updated | 2026-02-12 00:00 GMT |
Overview
Concrete tools for cross-package TypeScript type checking and ESLint linting provided by custom scripts and shared configuration.
Description
Two main tools handle code quality:
- scripts/type_check.js (L1-83): Uses commander for CLI parsing and listr2 for concurrent type checking across packages. Runs tsc --noEmit for each specified package.
- .eslintrc.js (L1-112): Root ESLint config extending @cypress/eslint-config with project-specific rules.
- packages/ts/tsconfig.json (L1-118): Base TypeScript configuration with target: ES2018, strict: true, skipLibCheck: true.
Usage
Run type checking and linting before committing changes or as part of CI validation.
Code Reference
Source Location
- Repository: cypress-io/cypress
- Files:
- scripts/type_check.js:L1-83 (type check runner)
- .eslintrc.js:L1-112 (ESLint config)
- packages/ts/tsconfig.json:L1-118 (base TypeScript config)
Signature
# Type checking
node scripts/type_check.js -p packages/config packages/server packages/driver
# Linting
eslint --fix "packages/*/src/**/*.{ts,tsx}"
Import
# From repo root
node scripts/type_check.js -p <packages...>
npx eslint --fix .
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| -p packages | string[] | Yes (type_check) | Package paths to type check |
| Source files | .ts/.tsx | Yes | TypeScript source files |
| .eslintrc.js | config | Yes | ESLint configuration |
| tsconfig.json | config | Yes | TypeScript configuration |
Outputs
| Name | Type | Description |
|---|---|---|
| Type errors | stderr | TypeScript type errors with file:line references |
| Lint errors | stderr | ESLint violations and warnings |
| Exit code | number | 0=clean, 1=errors found |
Usage Examples
Local Development
# Check types for specific packages
node scripts/type_check.js -p packages/config packages/server
# Lint and auto-fix
npx eslint --fix "packages/config/src/**/*.ts"
# CI validation (both)
yarn lint && node scripts/type_check.js -p packages/*
Related Pages
Implements Principle
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment