🚀 Feature Proposal
i18next-parser cannot currently handle TypeScript as casts within a JSX file. For example:
<Trans>
Hello, <strong>{{name} as any}</strong>!
</Trans>
gets extracted as "Hello, <1>{{ name } as any}</1>!" instead of "Hello, <1>{{name}}</1>!".
Motivation
As discussed in i18next/react-i18next#1483, React 18's type definitions cause TypeScript to start throwing errors for code such as
<Trans>
Hello, <strong>{{name}}</strong>!
</Trans>
since a { name } object is not a valid React child. react-i18next offers a new allowObjectInHTMLChildren option to adjust TypeScript's type definitions to allow this; however, it's a fairly drastic option and causes all React children everywhere to allow arbitrary objects (even if they're not part of <Trans>).
An alternative is to use an as any cast (or similar) at the call site:
<Trans>
Hello, <strong>{{name} as any}</strong>!
</Trans>
However, i18next-parser doesn't currently parse this properly.
Example
See above.