Free tools Windows power users keep installed
One-click scans. No signup required.
Use Babel to emit JavaScript and transform modern syntax for your chosen browsers or runtime; use TypeScript separately to check types and, when needed, generate declaration files. Babel’s TypeScript preset removes type syntax but does not validate types, so a Babel build alone is not a TypeScript check.
Choose what Babel and TypeScript each do
A common hybrid setup assigns JavaScript output to Babel and static analysis to TypeScript. The TypeScript Handbook describes this approach: Babel transpiles the source, while TypeScript can still check it and generate declarations when required. See the TypeScript Handbook’s Babel guide.
| Need | Tool or setting |
|---|---|
| Remove TypeScript annotations and emit JavaScript | Babel with @babel/preset-typescript |
| Transform modern JavaScript syntax for selected environments | Babel with @babel/preset-env and explicit targets |
| Check types | TypeScript, usually via tsc --noEmit |
| Generate declaration files for a package | TypeScript declaration emit as a separate step |
If you instead want TypeScript itself to emit JavaScript, use a TypeScript-led build rather than treating Babel’s output as equivalent. The important distinction is not whether both tools are installed, but which one emits and which responsibilities remain separate.
Install the presets your source needs
Install Babel core and the presets required by the project’s build pipeline. The two central presets are @babel/preset-typescript for TypeScript syntax and @babel/preset-env for modern JavaScript syntax. If the source contains JSX or TSX that needs React’s JSX transform, add @babel/preset-react as well.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →#1 Best Overall
- Babel’s TypeScript preset documentation
- Babel’s preset-env documentation
- Babel’s preset documentation
The TypeScript preset is not a general JSX transform. Ensure JSX/TSX handling is configured for the framework and JSX runtime your project uses.
Configure Babel for TypeScript and your target runtime
A minimal configuration shape for a Node project is below. node: "current" is only an example target; replace it with the browsers or runtime versions your application actually supports.
Rank #2
- TypeScript implements a superset of syntax for strictly typed development, facilitating deep static analysis and enhanced development environment integration. The compiler translates source into standard script formats, ensuring parity across any runtime.
- TypeScript is ideal for front-end developers, full-stack engineers, and software architects who build large-scale web applications. It serves those looking to improve code excellence, reduce bugs through static checking, and maintain complex projects more.
- Lightweight, Classic fit, Double-needle sleeve and bottom hem
{
"presets": [
["@babel/preset-env", { "targets": { "node": "current" } }],
"@babel/preset-typescript"
]
}
@babel/preset-env selects syntax transforms according to configured targets; it cannot guarantee compatibility with an environment that the project has not specified. Babel describes preset-env as a way to select needed syntax transforms, and optionally browser polyfills, for target environments in its official documentation. Syntax transformation and supplying runtime APIs are distinct concerns, so do not assume this preset alone provides every missing API.
Babel applies presets in reverse order. The example follows the common documented configuration shape, but if an integration or additional preset has ordering-sensitive behavior, verify that setup against that tool’s guidance and Babel’s preset documentation.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Handle the source file extensions
Babel’s TypeScript preset supports extension-specific behavior for TypeScript files, including .ts, .tsx, .mts and .cts. Its current documentation says this behavior is enabled by default; the ignoreExtensions option is available for cases such as nonstandard file extensions. If invoking Babel CLI or Node CLI directly, include .ts in the CLI extensions configuration so those files are processed.
Keep bundler module handling intentional
When using a bundler integration, leave preset-env’s modules option at its auto default in the usual case. Caller information from the integration can guide module handling. Set modules: false when preserving ES module syntax is explicitly the desired output; do not set it reflexively without considering how the bundler expects to receive modules.
Add TypeScript checking as a separate build step
Babel’s TypeScript transform strips TypeScript syntax; it does not type-check the program. Babel’s documentation is explicit: “This plugin does not add the ability to type-check the JavaScript passed to it.” A file can therefore compile through Babel and still fail TypeScript checking or behave unexpectedly.
- Run Babel through the project’s normal build or bundler pipeline to emit JavaScript.
- Run
tsc --noEmitin CI or the build workflow to check types without asking TypeScript to emit another JavaScript build. - If publishing a typed package, configure and run TypeScript declaration emit separately, then verify the generated declarations are included in the package.
TypeScript configuration and Babel configuration are not interchangeable. Babel does not automatically inherit changes made in tsconfig.json; review both configurations when changing module behavior or TypeScript syntax settings. Babel also operates with isolated-module assumptions, so features that require whole-program TypeScript analysis should be checked with TypeScript rather than inferred from successful Babel output. See the Babel TypeScript transform documentation and TypeScript’s hybrid workflow guide.
Best Value
Account for Babel version and import conventions
Do not treat every preset default as timeless: options can differ across Babel major versions. For example, the current preset documentation notes that onlyRemoveTypeImports defaults to true in Babel 8 and that allowDeclareFields will be enabled by default in Babel 8. Check the documentation for the Babel version installed in the project before relying on either behavior.
If source imports explicitly use .ts extensions, consider Babel’s rewriteImportExtensions option when the emitted JavaScript needs JavaScript extensions. Coordinate it with TypeScript’s allowImportingTsExtensions and rewriteRelativeImportExtensions settings and with the module-resolution conventions of the deployment runtime. This is a module-resolution decision, not a requirement for every Babel-and-TypeScript project.
Quick Recap
Validate the pipeline before relying on it
- Confirm Babel processes every intended TypeScript extension, including TSX where applicable.
- Confirm preset-env targets match the supported browsers or runtime versions.
- Confirm the bundler receives the module format it expects.
- Run TypeScript checking independently; a successful Babel build does not establish type safety.
- If the package exposes types, inspect declaration output and test that consumers can resolve it.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




