Registry / devops / cozy-tsconfig

cozy-tsconfig

JSON →
library2.0.0jsnpmunverified

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.

npm install cozy-tsconfig
INSTALL
IMPORT
SIG · COZY-TSCONFIG
C
cozy-tsconfig
devopsjavascriptv2.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

tsconfig.json
// in tsconfig.json: {"extends": "cozy-tsconfig"}
using require('cozy-tsconfig')
ESM-only since v2; must use JSON extends syntax.
cozy-tsconfig/tsconfig.strict.json
{"extends": "cozy-tsconfig/tsconfig.strict.json"}
{"extends": "cozy-tsconfig/strict"}
Strict variant provided; path must include full filename.
cozy-tsconfig/tsconfig.lib.json
{"extends": "cozy-tsconfig/tsconfig.lib.json"}
import from 'cozy-tsconfig/lib'
Library-specific config (no React JSX).

Shows how to extend the base shared config in a project's tsconfig.json.

// tsconfig.json { "extends": "cozy-tsconfig", "compilerOptions": { "outDir": "./build", "rootDir": "./src" }, "include": ["src"] } // Verify: npx tsc --showConfig
Debug
Known issues
breakingv2 requires TypeScript >=5.5.2, dropping support for older versions
fix
Update TypeScript to >=5.5.2
affects: >=2.0.0
breakingv2 drops CommonJS support; config files must be JSON, not JS
fix
Convert any .js config to .json and use extends syntax
affects: >=2.0.0
deprecatedv1 config path 'cozy-tsconfig/tsconfig.json' deprecated in v2
fix
Use 'cozy-tsconfig' in extends
affects: >=2.0.0
gotchaMust install typescript as devDependency, not just peer
fix
npm install --save-dev typescript@>=5.5.2
affects: >=2.0.0
Errors
Common errors & fixes
Cannot find module 'cozy-tsconfig'
Package not installed or not in node_modules
fix
npm install --save-dev cozy-tsconfig
Unknown compiler option 'extends'.
Using older TypeScript <2.1 (extends keyword)
fix
Update TypeScript to >=2.1 or use tsconfig.json with 'extends'
error TS5023: Unknown compiler option 'cozy-tsconfig'.
Trying to use cozy-tsconfig as a compiler option instead of extends
fix
Use 'extends': 'cozy-tsconfig' in tsconfig.json
Upgrade
Version history
2.0.0latest on npm
Audit
Dependencies
typescriptrequiredPeer dependency required for tsconfig to work
Agent activity
4 hits · last 30 days
node
4
Resources
cozy-tsconfig — npm install cozy-tsconfig · libregistry