Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix]
jsx-no-literals
: properly handle HTML entities when allowed
When an HTML entity such as — is checked with ESLint, the `value` property becomes the actual unicode character instead of the raw literal. This means if `—` is in the allowed strings array, and `—` is in the code being checked, the actual value used in the JSXText check will be `—`, which will not match against `—`, so it causes a false positive error. When checking against the set of allowed strings, this will now check both the `value` and the `raw` properties of the node. For `—`, the `raw` property will still be `—`. If _either_ of these match the list of allowed values, then no error will be returned. Fixes #3130 Co-authored-by: Joe Attardi <attardi@synopsys.com> Co-authored-by: Ross <52366381+ROSSROSALES@users.noreply.github.com>
- Loading branch information