Skip to content

Commit 42098b9

Browse files
andrelmlinsljharb
andcommitted
[Refactor] img-redundant-alt: removing a use of some
Co-authored-by: Jordan Harband <[email protected]>
1 parent 89acdc4 commit 42098b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rules/img-redundant-alt.js

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

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

6464
if (hasRedundancy === true) {
6565
context.report({

0 commit comments

Comments
 (0)