Skip to content

Commit 89acdc4

Browse files
andrelmlinsljharb
authored andcommitted
fix: removing the use of the some function
1 parent bdc8c2c commit 89acdc4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/rules/img-redundant-alt.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ module.exports = {
5959
const redundantWords = REDUNDANT_WORDS.concat(words);
6060

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

6564
if (hasRedundancy === true) {
6665
context.report({

0 commit comments

Comments
 (0)