TypeScript support with strictNullChecks false #2085
LaGregance
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there,
I've been working on integrating i18next into my React Native project and have encountered an issue related to TypeScript typechecking. It seems that making the
i18next.t
function cooperate with TypeScript's typechecking for key parameters becomes challenging when the strictNullChecks option is set to false in the tsconfig.Currently, the situation is somewhat functional but has limitations. We can successfully call
i18next.t
when providing the default namespace prefix, like this:However, attempting to call it without the namespace results in a TypeScript error:
I believe this limitation could pose a barrier to adoption for projects that choose to use the
strictNullChecks: false
option in their tsconfig. In my case, enabling this option led to thousands of errors, making it impractical. Given that, this option is a huge comfort in my opinion, especially for frontend projects.While I understand that the current documentation outlines this behavior, I wanted to open a discussion to gather perspectives on the matter:
strictNullChecks: false
is a relevant feature?I believe addressing this concern could benefit many projects and would appreciate any insights or feedback on this topic.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions