avajs / babel

Babel provider for AVA.
11 stars 3 forks source link

Allow ".ts" in addition to "ts" when configuring extensions for Babel #27

Closed vedantroy closed 4 years ago

vedantroy commented 4 years ago

Right now, if we want to specify file extensions, we have to use ["ts", "js"] etc. However, this differs from the way @babel/register accepts extensions, example:

require('@babel/register')({
   extensions: ['.ts']
})

This creates an inconsistency, because it means we cannot use the same configuration for configuring both @babel/register and @ava/babel. Would it be possible to add support for ".ts", so that people can use the same configuration for multiple tools?

novemberborn commented 4 years ago

because it means we cannot use the same configuration for configuring both @babel/register and @ava/babel.

But you can't, really, anyway. In that: you can't reuse the same object.

I understand the frustration with the inconsistency, but similarly I don't want to have different syntaxes within AVA, and I don't think it's worth having a breaking change over this either.