DEV Community

Discussion on: Generating TypeScript Definition Files from JavaScript

Collapse
 
evanplaice profile image
Evan Plaice

TSC seems to be blocking typings creation on vanilla JS now

The error:

error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.

My config:

  "compilerOptions": {
    "target": "esnext",
    "noEmit": false,
    "declaration": true,
    "allowJs": true,
    "checkJs": true,
    "emitDeclarationOnly": true
  }

Here's the issue on GH:
github.com/microsoft/TypeScript/is...

Collapse
 
dakmor profile image
Thomas Allmer

yes totally correct - it's written here dev.to/open-wc/generating-typescri...

Basically that means that currently there is an official TypeScript branch that allows it but might still take some time (as far as I can tell 3.7 still looks like the goal - but you know how plans sometimes change 😅)

So if you want to use it now you will need to either use a forked version or somehow make this branches code available to your project.

Collapse
 
evanplaice profile image
Evan Plaice

Thank you so much. I dug a bit on my own but didn't see any reference about a fix being worked on.

Also, saw your post on Twitter saying this has been officially released now. Awesome!