Skip to content

Add ability to disable one of Babel or TypeScript transpilation, but not the other #874

Open
@tbroadley

Description

I'm working on a project that uses both Babel and TypeScript. It has a dangerfile written in TypeScript that imports a JavaScript file. That JS file in turn imports a JS file from a package in node_modules. The issue is that the JS file uses the new keyword to instantiate an ES6 class defined in the JS file from the package. Danger uses Babel to transpile the file to ES5. The transpiled code doesn't use new to instantiate the ES6 class (which isn't transpiled because it's in node_modules), leading to a Class constructor ClassName cannot be invoked without 'new' error.

I know that there's a way to disable all transpilation. However, I want to keep transpiling TypeScript so that I can write the dangerfile in TypeScript. It would be useful to just be able to disable Babel transpilation while continuing to transpile TypeScript (or maybe vice versa for a different use case).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    You Can Do ThisThis idea is well spec'd and ready for a PR

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions