the following setup seems not to work:
<button type="button" ></button>
with the rule
'react/jsx-no-literals': [
'warn',
{
noStrings: true,
allowedStrings: ['button', 'submit'],
},
],
produces the following error: Invalid prop value: “type="button"” react/jsx-no-literals
Context: I'm trying to find a balance between enforcing no literals but also react/button-has-type
That should definitely work - jsx-no-literals shouldn't be warning on a prop value.
The ignoreProps option might help, however.
ignoreProps works, in general, but also doesn't check any props at all. It seems that the allowedStrings are not checked in props at all.
I believe I have a solution for this. I will open a PR later today
Most helpful comment
I believe I have a solution for this. I will open a PR later today