Registry / devops / tsconfig-migrate

tsconfig-migrate

JSON →
library0.2.0jsnpmunverified

tsconfig-migrate is a utility for converting TypeScript compilerOptions to equivalent options for other transpilers like oxc and swc. Current version 0.2.0, released as an experimental tool. It helps developers migrate from tsc to faster alternatives by translating TSConfig settings into transformer-specific configurations. Differentiates by supporting multiple targets (oxc, swc) and being lightweight with zero dependencies.

npm install tsconfig-migrate
INSTALL
IMPORT
SIG · TSCONFIG-MIGRATE
T
tsconfig-migrate
devopsjavascriptv0.2.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.

migrate
import migrate from 'tsconfig-migrate/oxc.js'
import migrate from 'tsconfig-migrate'
Default export from subpath, not main entry.
migrate
import migrate from 'tsconfig-migrate/swc.js'
import { migrate } from 'tsconfig-migrate/swc.js'
Default export, not named.
migrate
const migrate = require('tsconfig-migrate/oxc.js')
const migrate = require('tsconfig-migrate')
CJS require works with subpath, but main entry not defined.

Migrates TypeScript compilerOptions to swc configuration and transforms code.

import migrate from 'tsconfig-migrate/swc.js'; import { transform } from '@swc/core'; const compilerOptions = { target: 'ES2020', module: 'ESNext', strict: true, jsx: 'react-jsx', }; const swcConfig = migrate(compilerOptions); const result = transform('const x: number = 1;', swcConfig); console.log(result.code);
Debug
Known issues
breakingtsconfig-migrate may not support all compilerOptions, leading to silent fallbacks or ignored options.
fix
Check the source or tests to see which options are mapped; verify output configuration manually.
affects: <=0.2.0
deprecatedNo deprecations recorded yet, but package is experimental and API may change.
fix
Pin to a specific version and monitor releases for breaking changes.
affects: >=0.0.0
gotchaImporting from the main entry 'tsconfig-migrate' fails because no default export is defined there.
fix
Use subpath imports: 'tsconfig-migrate/oxc.js' or 'tsconfig-migrate/swc.js'.
affects: >=0.2.0
gotchaThe migrate function expects a full compilerOptions object; partial objects may cause unexpected behavior.
fix
Provide a complete compilerOptions object, or at least include target and module.
affects: <=0.2.0
Errors
Common errors & fixes
Cannot find module 'tsconfig-migrate' or its corresponding type declarations.
Importing from the package root instead of subpath.
fix
Use import migrate from 'tsconfig-migrate/oxc.js';
TypeError: migrate is not a function
Importing as named export instead of default export.
fix
Use import migrate from '...' (default import).
Upgrade
Version history
0.2.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
tsconfig-migrate — npm install tsconfig-migrate · libregistry