feat: add reset=true arg to @generateTypes#485
feat: add reset=true arg to @generateTypes#485Raigato wants to merge 3 commits intodmno-dev:mainfrom
Conversation
… vars to unknown type When reset=true, both ProcessEnv and ImportMetaEnv gain a [key: string]: unknown index signature, making TypeScript flag accesses to undeclared env variables.
🦋 Changeset detectedLatest commit: bfd7c1d The changes in this PR will be included in the next version bump. This PR includes changesets to release 12 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Concept makes sense but not sure about the "reset" naming. Maybe something like Also curious - why not use the |
Indeed, was not sure about the naming either, thought it like a css reset but strict makes sense. Dunno about the ability to let the types free wheeling by not generating them. IMO, the Concerning the
|
Summary
strict=trueargument to the@generateTypesdecoratorenv.d.tsadds a[key: string]: unknownindex signature to bothProcessEnvandImportMetaEnv, making TypeScript flag accesses to undeclared env variables asunknownrather than implicitly allowing them@generateTypes(lang=ts, path=env.d.ts, strict=true)