docs: Note the new TS option for throwOnInvalid.#1415
docs: Note the new TS option for throwOnInvalid.#1415CarsonF wants to merge 1 commit intomoment:masterfrom
Conversation
|
|
pvogel1967
left a comment
There was a problem hiding this comment.
This doc is inadequate. Should be clear this should be in a local types/luxon/index.d.ts file and it should import { TSSettings } from 'luxon' to ensure the module declare here is merged with the main types module from DefinitelyTyped.
No this does not have to be in a locally configured "types" folder. It should be done in the same spot as you enable the runtime setting, as I thought the doc change communicated by being right under that runtime setting. That setting has to be executed early on in your application, and doing so means TS picks it up and includes it (merges the interface correctly). |
I am adding support for the invalid return types in the TypeScript definitions.
DefinitelyTyped/DefinitelyTyped#64995
With this I added a way to opt-in to the stricter types when
throwOnInvalidis enabled.I'm documenting this here for users, since we don't really have another documentation place.