param-mismatch
A translate call whose params differ from the placeholders of the source message.
The check is on by default, with the severity warning.
The check compares the params a translate call passes with the placeholders of the source message. For "greet": "Hello {{name}}", it reports t('greet', { nam }): name is missing and nam is unused.
It needs a preset that tells where the params of a call are; the i18next presets do. Options the library reads itself, such as i18next count, context and defaultValue, are never unused. Unused params are reported only when the message has placeholders and no nested messages ($t(key)), which may use them.
The check skips a call whose params it cannot read, such as a variable or a spread (t('greet', opts)), and a key whose source message is not a string, such as a plural key that only has greet_one and greet_other.
Configure
Change the severity, or turn the check off, in checks:
import { defineConfig } from '@x18n/core'
export default defineConfig({
checks: {
'param-mismatch': 'off',
},
})x18n check --only param-mismatch runs this check alone. x18n check --skip param-mismatch skips it for one run.