Cozy TypeScript Config
raw JSON → 2.0.0 verified Fri May 01 auth: no javascript
Shared TypeScript configuration for Cozy Cloud projects. Version 2.0.0 requires TypeScript >=5.5.2 and Node >=16.0.0. It extends a base config and can be overridden per project. Part of the cozy-libs monorepo. Key differentiator: pre-configured for Cozy Cloud's specific needs (React, strict checks, paths for cozy packages). Regularly updated alongside Cozy ecosystem.
Common errors
error Cannot find module 'cozy-tsconfig' ↓
cause Package not installed or not in node_modules
fix
npm install --save-dev cozy-tsconfig
error Unknown compiler option 'extends'. ↓
cause Using older TypeScript <2.1 (extends keyword)
fix
Update TypeScript to >=2.1 or use tsconfig.json with 'extends'
error error TS5023: Unknown compiler option 'cozy-tsconfig'. ↓
cause Trying to use cozy-tsconfig as a compiler option instead of extends
fix
Use 'extends': 'cozy-tsconfig' in tsconfig.json
Warnings
breaking v2 requires TypeScript >=5.5.2, dropping support for older versions ↓
fix Update TypeScript to >=5.5.2
breaking v2 drops CommonJS support; config files must be JSON, not JS ↓
fix Convert any .js config to .json and use extends syntax
deprecated v1 config path 'cozy-tsconfig/tsconfig.json' deprecated in v2 ↓
fix Use 'cozy-tsconfig' in extends
gotcha Must install typescript as devDependency, not just peer ↓
fix npm install --save-dev typescript@>=5.5.2
Install
npm install cozy-tsconfig yarn add cozy-tsconfig pnpm add cozy-tsconfig Imports
- tsconfig.json wrong
using require('cozy-tsconfig')correct// in tsconfig.json: {"extends": "cozy-tsconfig"} - cozy-tsconfig/tsconfig.strict.json wrong
{"extends": "cozy-tsconfig/strict"}correct{"extends": "cozy-tsconfig/tsconfig.strict.json"} - cozy-tsconfig/tsconfig.lib.json wrong
import from 'cozy-tsconfig/lib'correct{"extends": "cozy-tsconfig/tsconfig.lib.json"}
Quickstart
// tsconfig.json
{
"extends": "cozy-tsconfig",
"compilerOptions": {
"outDir": "./build",
"rootDir": "./src"
},
"include": ["src"]
}
// Verify: npx tsc --showConfig