Socket
Socket
Sign inDemoInstall

@babel/preset-typescript

Package Overview
Dependencies
62
Maintainers
6
Versions
83
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/preset-typescript

Babel preset for TypeScript.


Version published
Maintainers
6
Weekly downloads
15,578,306
decreased by-4.6%

Weekly downloads

Package description

What is @babel/preset-typescript?

The @babel/preset-typescript package is a Babel preset for TypeScript, which allows Babel to parse and transform TypeScript code into JavaScript. This enables developers to use TypeScript's static typing features while leveraging Babel's ability to compile modern JavaScript to be compatible with older browsers or environments.

What are @babel/preset-typescript's main functionalities?

TypeScript Compilation

Compiles TypeScript code to JavaScript by stripping out type annotations and handling TypeScript-specific syntax.

const x: number = 10;

Support for TypeScript Features

Supports various TypeScript features like enums, interfaces, and namespaces, converting them to equivalent JavaScript code.

enum Color { Red, Green, Blue }; let c: Color = Color.Green;

Integration with Babel Toolchain

Easily integrates with the Babel toolchain, allowing TypeScript files to be included in Babel's build process alongside other JavaScript files.

module.exports = { presets: ['@babel/preset-typescript'] };

Other packages similar to @babel/preset-typescript

Changelog

Source

v7.15.0 (2021-08-04)

:eyeglasses: Spec Compliance
  • babel-parser
    • #13523 feat(ts): raise error for abstract property with initializer (@fedeci)
:rocket: New Feature
  • babel-parser
    • #13229 Add attachComment parser option to disable comment attachment (@JLHwung)
  • babel-standalone
  • babel-parser, babel-preset-env
  • babel-plugin-transform-typescript, babel-preset-typescript
  • babel-plugin-transform-typescript
  • babel-core, babel-helper-create-class-features-plugin, babel-helper-module-transforms, babel-plugin-transform-modules-commonjs
    • #13290 feat: add noIncompleteNsImportDetection assumption to plugin-transform-modules-commonjs (@fedeci)
  • babel-plugin-transform-react-display-name
  • babel-parser, babel-plugin-proposal-pipeline-operator, babel-plugin-syntax-pipeline-operator
  • babel-generator, babel-parser, babel-plugin-proposal-pipeline-operator, babel-plugin-syntax-pipeline-operator, babel-traverse, babel-types
  • babel-plugin-transform-runtime
  • babel-compat-data, babel-helper-compilation-targets, babel-preset-env
  • babel-compat-data, babel-parser, babel-preset-env
:bug: Bug Fix
  • babel-parser, babel-plugin-transform-typescript
  • babel-plugin-transform-typescript
    • #13605 Handle typescript function overloading in a default export (@tony-go)
  • babel-parser
:memo: Documentation

We have to split the v7 changelog in multiple files otherwise it's too big to render on GitHub.

Readme

Source

@babel/preset-typescript

Babel preset for TypeScript.

See our website @babel/preset-typescript for more information or the issues associated with this package.

Install

Using npm:

npm install --save-dev @babel/preset-typescript

or using yarn:

yarn add @babel/preset-typescript --dev

Keywords

FAQs

Last updated on 04 Aug 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc