With the latest advancements in TypeScript, it's now possible to infer the correct paths from an object type. TypeScript 4.1 introduces recursive conditional types, and there is a PR open that will enable string type concatenation on the type level.
18next.t accepts arbitrary strings. This allows silly human errors, since it's easy to make a typo.
I put together a TypeScript Playground illustrating the improved definition.
Once https://github.com/microsoft/TypeScript/pull/40336 is merged and released, the improved definition can be put in a separate file loaded only for the ones using the minimum required TypeScript version. In package.json, it should say:
{
"typesVersions": {
">=4.1.0-0": {
"*": [
/* Path to the new definition */
]
}
}
}
Very nice! Once the new TS is released, we can accept a PR for this. We may need to think about modifying our usage tests so that we can properly test it, we currently do not have any expect error notations being used.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This should be reopened, it is a must have feature and we already have a solution for it.
stalebot
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
up!?
Most helpful comment
up!?