Open ryancwalsh opened 2 months ago
Thanks for this library. It looks like it will be super useful.
Currently, my rule in my .eslintrc.json is:
.eslintrc.json
"i18next/no-literal-string": [ "warn", { "jsx-attributes": { "include": ["alt", "placeholder", "aria-label", "title", "subtitle"] }, "message": "Use i18n translation keys instead of literal strings.", "mode": "jsx-only", "object-properties": { "include": ["title", "body", "label"] } } ]
It's working well in some cases like:
But I was hoping it would also flag a warning for objects like this:
const dialogProps: DialogProps = { type: 'icon', title: 'Card Verification failed', body: 'Something went wrong. Please recheck your card details and try again.', dismissButton: { label: 'Dismiss', }, dismiss: unshift, };
No warnings:
What changes can I make to get it to catch strings like those?
Thank you so much for your help!
Use mode: 'all' instead. You might be surprised what it captures
mode: 'all'
Thanks for this library. It looks like it will be super useful.
Currently, my rule in my
.eslintrc.json
is:It's working well in some cases like:
But I was hoping it would also flag a warning for objects like this:
No warnings:
What changes can I make to get it to catch strings like those?
Thank you so much for your help!