Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to provide a different tsconfig path for generated bundle validation #293

Open
HarelM opened this issue Jan 24, 2024 · 0 comments
Open

Comments

@HarelM
Copy link

HarelM commented Jan 24, 2024

In continue to the following discussion:
#291 (comment)

And in continue to some reports from users that used the generated d.ts file that was generated from this tool:
maplibre/maplibre-gl-js#934

It would be great to be able to set strict mode on the generated types - i.e. do the validation of the output with typescript strict:true flag.

Workaround

The current workaround that I use is to create a new tsconfig.json file, just to validate the generated d.ts file.
If my library was adhering to strict: true then the types were also adhering to it, but I can't change my entire library to be strict (I tried and failed...).

This is the relevant file for the workaround:
https://github.com/maplibre/maplibre-gl-js/blob/fa7372f0493579a60bdf6ac8f1547deb3bc1bcee/tsconfig.dist.json

{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "strict": true,
    "types": [
      "geojson",
      "offscreencanvas"
    ]
  },
  "include": [
    "dist/maplibre-gl.d.ts"
  ],
  "exclude": []
}

And I'm using the following command to validate the d.ts file:
npx tsc --project tsconfig.dist.json

@timocov timocov added this to the 10.0 milestone Jan 24, 2024
@timocov timocov changed the title [Feature Request] use strict validation Allow to provide a different tsconfig path for generated bundle validation Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants