Ask Question

JavaScript imports in Typescript

Typescript folks!

Is there any way to get TS to be OK with JS imports? I accept that they will be opaque, and all the red is distracting.

I have allowJs set to true in my tsconfig.

Image nr: 0

TypeScript

1255 views

T

tom

Last edited on

1 Answer available

Best answer

Create a .d.ts (the name doesn't matter, just the extension) file in your repository that has the following contents:

declare module "@.components/*";