-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
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
support jsx-no-literals on specific attributes #2486
Labels
Comments
such as? |
All HTML element attributes that aren’t enums should always be checked by this rule, I’d think. |
Makes sense to me. Just noticed a few alt and title attributes that were missed. |
Can you provide example code, how you expect it to be linted, and how it is? |
yep Fail: <img alt='alt string' {...props} />
<figure title='title string' {...props} /> Pass: <img alt={translate(strings.altString)} {...props} />
<figure title={translate(strings.titleString)} {...props} /> Currently both pass |
4 tasks
ljharb
pushed a commit
to TaLeaMonet/eslint-plugin-react
that referenced
this issue
Sep 16, 2020
Co-authored-by: TaLea Carpenter <[email protected]> Co-authored-by: tanmoyopenroot <[email protected]> Fixes #jsx-eslint#2486
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For
react/jsx-no-literals
the default likely should not allow string literals on "title" and "alt" attributes, but allow configuration for component patterns that pass user strings in other ways.The text was updated successfully, but these errors were encountered: