Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-preset-proposal-typescript

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-preset-proposal-typescript

Yet another Babel preset for TypeScript, only transforms proposals which TypeScript does not support now.

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
72
decreased by-92.52%
Maintainers
1
Weekly downloads
 
Created
Source

babel-preset-proposal-typescript

Travis Codecov David David Peer David Dev Greenkeeper badge

Yet another Babel preset for TypeScript, only transforms proposals which TypeScript does not support now.

So that you can use babel to transform proposals which are current in stage 0-2 and TypeScript team will not implement them temporarily.

Enabled proposal plugins

  1. do-expressions
  2. function-bind
  3. function-sent
  4. json-strings
  5. logical-assignment-operators
  6. nullish-coalescing-operator
  7. optional-chaining
  8. pipeline-operator
  9. throw-expressions

Install

npm install --save-dev babel-preset-proposal-typescript # npm
yarn add -D babel-preset-proposal-typescript # yarn

Usage

.babelrc

{
  "presets": ["proposal-typescript"]
}

Via CLI

babel input.ts --presets proposal-typescript > output.ts

Via Node API

require("@babel/core").transform("code", {
  presets: ["proposal-typescript"]
});

Via webpack

Pipe codes through babel-loader to ts-loader or awesome-typescript-loader.

loader = {
  test: /\.ts$/,
  use: [{
    loader: 'ts-loader'
  }, {
    loader: 'babel-loader',
    options: {
      presets: ['proposal-typescript']
    }
  }]
}

Keywords

FAQs

Package last updated on 31 Aug 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc