1. babel-plugin-transform-typescript
Transform TypeScript into ES.next
babel-plugin-transform-typescript
Package: babel-plugin-transform-typescript
Created by: babel
Last modified: Mon, 11 Apr 2022 16:45:54 GMT
Version: 7.0.0-alpha.19
License: MIT
Downloads: 16,600
Repository: https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-typescript

Install

npm install babel-plugin-transform-typescript
yarn add babel-plugin-transform-typescript

babel-plugin-transform-typescript

Transform TypeScript into ES.next.

Does not type-check its input. For that, you will need to install and set up TypeScript.

Does not support namespaces or const enums because those require type information to transpile.
Also does not support export = and import =, because those cannot be transpiled to ES.next.

Example

In

 const x: number = 0;

Out

 const x = 0;

Installation

 npm install --save-dev babel-plugin-transform-typescript

Usage

Via .babelrc (Recommended)

.babelrc

 {
  "plugins": ["transform-typescript"]
}

Via CLI

 babel --plugins transform-typescript script.js

Via Node API

 require("babel-core").transform("code", {
  plugins: ["transform-typescript"]
});

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code