fix(types): expose enableSelector on InitOptions (#2431)
`enableSelector` is a runtime option — `i18next.js` reads
`opts?.enableSelector === 'strict'` inside `keysFromSelector` and applies
the namespace-prefix rewrite accordingly — but it isn't declared on
`InitOptions`. So `i18n.init({ enableSelector: 'strict' })` fails to
typecheck with:
Object literal may only specify known properties, and
'enableSelector' does not exist in type 'InitOptions<unknown>'.
`CustomTypeOptions['enableSelector']` exists for the type-level selector
machinery, but that only configures the compile-time shape. The runtime
value still has to be passed at init() time, and the matching
InitOptions field was missing.
Adds `enableSelector` to InitOptions alongside `keySeparator` and
`nsSeparator`, and adds an i18nInstance.test.ts case covering each
accepted value (false / true / 'optimize' / 'strict'). D
Dmitrii Kartashev committed
50509e4c916c44996e23f01e7bfbceda79b62870
Parent: 80b5402
Committed by GitHub <noreply@github.com>
on 5/14/2026, 7:04:05 PM