Skip to content

Commit

Permalink
fix: removing the use of the some function
Browse files Browse the repository at this point in the history
  • Loading branch information
andrelmlins authored and ljharb committed Apr 30, 2020
1 parent bdc8c2c commit 89acdc4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/rules/img-redundant-alt.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ module.exports = {
const redundantWords = REDUNDANT_WORDS.concat(words);

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

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

0 comments on commit 89acdc4

Please sign in to comment.