Registry / devops / typescript-config-carbon

typescript-config-carbon

JSON →
library0.10.0jsnpmunverified

A sharable TypeScript configuration preset for projects using the Carbon Design System. v0.10.0, versioned alongside Carbon releases. Provides strict settings aligned with Carbon's coding conventions, including strictNullChecks and noUnusedLocals. Differentiates from generic presets by tailoring paths and module resolution for Carbon's monorepo structure. Updated for Carbon v11 compatibility.

npm install typescript-config-carbon
INSTALL
IMPORT
SIG · TYPESCRIPT-CONFIG-
T
typescript-config-carbon
devopsjavascriptv0.10.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.

extends
// tsconfig.json { "extends": "@carbon/tsconfig" }
// Using in tsconfig.json as an array without proper path
Use string reference in tsconfig.json's extends field; do not use require().
tsconfig.json
{ "extends": "@carbon/tsconfig", "compilerOptions": { "outDir": "dist" }, "include": ["src"] }
{ "extends": "@carbon/tsconfig/tsconfig.json", ... }
Path without '/tsconfig.json' is correct; package.json specifies main file.
@carbon/tsconfig
import * as config from '@carbon/tsconfig';
const config = require('@carbon/tsconfig');
ESM-only since v0.10.0; no CommonJS export.

Install the config package and extend it in tsconfig.json for a Carbon project.

// install yarn add --dev @carbon/typescript-config typescript // tsconfig.json { "extends": "@carbon/tsconfig", "compilerOptions": { "outDir": "lib", "rootDir": "src" }, "include": ["src"] } // then compile: // npx tsc
Debug
Known issues
breakingPackage renamed from @carbon/typescript-config to @carbon/tsconfig at v0.10.0
fix
Update package.json dependency to @carbon/tsconfig and change extends field accordingly.
affects: <0.10.0
deprecatedv0.9.0 deprecated commonjs output; use ESM-only.
fix
Switch to ESM imports; no require().
affects: >=0.9.0 <0.10.0
gotchaConfig assumes module: 'node16' or 'nodenext'; older settings may cause resolution errors.
fix
Set module to node16 or nodenext in your tsconfig if overriding.
affects: >=0.10.0
Errors
Common errors & fixes
Cannot find module '@carbon/tsconfig' or its corresponding type declarations.
Package not installed or old name used.
fix
Install @carbon/tsconfig (not @carbon/typescript-config) and ensure extends points to '@carbon/tsconfig'.
error TS5098: Option 'module' must be set to 'Node16' when option 'moduleResolution' is set to 'Node16'.
Incompatible module and moduleResolution settings after extending config.
fix
Set module: 'node16' in your tsconfig.json or remove conflicting overrides.
Type error: 'JSX' must be 'react-jsx' when using Carbon components.
Incorrect JSX setting.
fix
Ensure your tsconfig includes "jsx": "react-jsx" if not already defined.
Upgrade
Version history
0.10.0latest on npm
Audit
Dependencies
typescriptoptionalPeer dependency; must be installed to use the config
Agent activity
4 hits · last 30 days
node
4
Resources
typescript-config-carbon — npm install typescript-config-carbon · libregistry