0

Running tsc --out output.js --declaration input.ts

returns output.js and output.d.ts as expected. The d.ts file contains JavaScript instead of type declarations.

This procedure used to work 9 days ago, and I haven't updated TypeScript since.

Any ideas on what might be going on?

Doug
  • 2,441
  • 2
  • 19
  • 22

2 Answers2

0

ideas on what might be going on?

Seems like a bug. They might have broken parsing in the compiler rewrite.

I'd do : tsc input.ts --out output.js --declaration

basarat
  • 261,912
  • 58
  • 460
  • 511
0

It seems to be a bug in the compiler.

Steve Fenton helped us out with the code fix, so this post is a proxy for his efforts.

Ultimately, invalid TypeScript was compiling to JavaScript, and the indication of the error was a type declaration file that output as JavaScript.

This isn't really an answer so I won't mark it as one. But there is definitely an odd bug in the TypeScript compiler that is hard to reproduce.

Community
  • 1
  • 1
Doug
  • 2,441
  • 2
  • 19
  • 22