We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
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
react/button-has-type
The text was updated successfully, but these errors were encountered:
That should definitely work - jsx-no-literals shouldn't be warning on a prop value.
The ignoreProps option might help, however.
ignoreProps
Sorry, something went wrong.
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.
allowedStrings
I believe I have a solution for this. I will open a PR later today
de268ec
Successfully merging a pull request may close this issue.
the following setup seems not to work:
with the rule
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
The text was updated successfully, but these errors were encountered: