Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

195
Visualizações
Handling "export X from 'Y'" when generating d.ts files

I am using TypeScript to generate d.ts files from our existing JavaScript codebase which is annotated using JSDoc, as per https://www.typescriptlang.org/docs/handbook/declaration-files/dts-from-js.html.

My problem is that the TS compiler (understandably) cannot handle some non-TS syntax which otherwise is parseable using Babel, specifically export x from 'y', e.g.

export { something } from './somewhere';

This yields the following when emitting types:

app/utils/index.js:76:1 - error TS1128: Declaration or statement expected.

76 export { something } from './somewhere';

I have tried adding the ts-ignore annotation, but it does not seem to work (I am using TS 4.5). I get the same error as above.

// @ts-ignore
export { something } from './somewhere';

Apart from removing this syntax (which is not feasible since we use it a lot), what would be the preferred way of solving this?

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda