Skip to content

Commit

Permalink
Update src/rules/img-redundant-alt.js
Browse files Browse the repository at this point in the history
Co-authored-by: Jordan Harband <ljharb@gmail.com>
  • Loading branch information
andrelmlins and ljharb committed Jun 11, 2020
1 parent da3f081 commit 2582229
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rules/img-redundant-alt.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ module.exports = {
const redundantWords = REDUNDANT_WORDS.concat(words);

if (typeof value === 'string' && isVisible) {
const hasRedundancy = Boolean(value.match(new RegExp(`(?!{)\\b(${redundantWords.join('|')})\\b(?!})`, 'i')));
const hasRedundancy = new RegExp(`(?!{)\\b(${redundantWords.join('|')})\\b(?!})`, 'i').test(value);

if (hasRedundancy === true) {
context.report({
Expand Down

0 comments on commit 2582229

Please sign in to comment.