You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 10, 2021. It is now read-only.
If an import contains additional dots, i.e if you are using a _"type exentensions"_™ this plugin will not add the actual extensions.
import { somethingBackFromOther } from '../lib/something.lib'should be transformed to import { somethingBackFromOther } from '../lib/something.lib.js', but it stays untouched.
However those filenames are quite common in a lot of frameworks (i.e. component.style.ts, component.test.ts, ...), actually the default extension for Jest tests is test.js (and thus in typescript test.ts).
This needs some consideration on how to combine this with the ability to replace an extension. I skimmed through the code and for me personally it is pretty dense (asi, nested destructuring, no comments, ...) so I can't come up with an easy fix w/o re-writing larger parts of it. Maybe @karlprieb can fix this in an instant. :)
The text was updated successfully, but these errors were encountered:
Sorry @ChristianUlbrich i didn't have time to fix this, can you open a PR adding the test cases? I'll probaly continue the work from your branch :)
Thank you!
If an import contains additional dots, i.e if you are using a _"type exentensions"_™ this plugin will not add the actual extensions.
import { somethingBackFromOther } from '../lib/something.lib'
should be transformed toimport { somethingBackFromOther } from '../lib/something.lib.js'
, but it stays untouched.However those filenames are quite common in a lot of frameworks (i.e.
component.style.ts
,component.test.ts
, ...), actually the default extension for Jest tests istest.js
(and thus in typescripttest.ts
).I have added test cases at least for the imports at https://github.com/ChristianUlbrich/babel-plugin-add-import-extension that will fail.
This needs some consideration on how to combine this with the ability to replace an extension. I skimmed through the code and for me personally it is pretty dense (asi, nested destructuring, no comments, ...) so I can't come up with an easy fix w/o re-writing larger parts of it. Maybe @karlprieb can fix this in an instant. :)
The text was updated successfully, but these errors were encountered: