ews-javascript-api icon indicating copy to clipboard operation
ews-javascript-api copied to clipboard

Declarations breaks typescript build when "skipLibCheck" is false

Open JuanMurciaN opened this issue 1 year ago • 4 comments
trafficstars

Environment:

  • nodejs 18.20.4
  • npm 10.5.1

The library breaks typescript projects that check library's .d.ts files because a handful of these files are missing the exported members. Attached is a dummy project that recreates the failure, but it can be easily recreated by

  • Create a new npm project with npm init
  • Install typescript
  • Init typescript with npx tsc --init
  • Remove, or set to false skipLibCheck inside tsconfig.json
  • Install the library with npm i ews-javascript-api
  • Create a dummy file that imports something from the library
  • Build using npx tsc

dummy.zip

JuanMurciaN avatar Oct 11 '24 20:10 JuanMurciaN

there are some problem which breaks this specific flag, PR welcome.

gautamsi avatar Oct 12 '24 04:10 gautamsi

The issue is caused by the stripInternal flag set to true in the compilation options. Making all exports with an @internal comment not appear on their declaration files. If this is on purpose then the project cannot work with skipLibCheck: false unless the problematic exports @internal documentation comments are removed.

Edit: quote @internal to avoid tagging an unrelated user

JuanMurciaN avatar Oct 28 '24 20:10 JuanMurciaN

I was trying to create a PR, but I don't think I have permissions to push to a side branch

JuanMurciaN avatar Oct 28 '24 20:10 JuanMurciaN

you have to push to your fork and then create PR

gautamsi avatar Oct 28 '24 21:10 gautamsi