🚀 Feature Proposal
Add a new boolean type option that, when enabled and suspense is disabled, makes the UseTranslationResponse type evaluate to something like { t: TFunction; ready: true; } | { ready?: false; }.
That would provoke a type error if t is accessed without first checking ready.
Motivation
Disabling suspense can result in snappier loading behavior, but if you forget to check ready, you tend to get i18n keys visibly rendered on your site.
Unfortunately, to make use of this you would have to avoid destructuring the useTranslation return value and use i18n.ready and i18n.t, which is why it should be opt-in behavior.
I'm also not sure if and how it would affect the non-hook stuff.
Example
declare module 'i18next' {
interface CustomTypeOptions {
strictNoSuspense: true,
}
}
const Component = () => {
const i18n = useTranslation(['translation'], {useSuspense: false});
i18n.t($ => $.foo); // error!
i18n.ready && i18n.t($ => $.foo); // ok
};