Skip to content

Commit

Permalink
[Fix]: Use of array-includes for env under es6
Browse files Browse the repository at this point in the history
  • Loading branch information
makotot committed Jan 9, 2024
1 parent f270961 commit 7058725
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rules/img-redundant-alt.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// ----------------------------------------------------------------------------

import { getProp, getLiteralPropValue } from 'jsx-ast-utils';
import includes from 'array-includes';
import { generateObjSchema, arraySchema } from '../util/schemas';
import getElementType from '../util/getElementType';
import isHiddenFromScreenReader from '../util/isHiddenFromScreenReader';
Expand All @@ -30,7 +31,7 @@ function containsRedundantWord(value, redundantWords) {
const isASCII = /[\x20-\x7F]+/.test(value);

if (isASCII) {
return value.split(/\s+/).some((valueWord) => lowercaseRedundantWords.includes(valueWord.toLowerCase()));
return value.split(/\s+/).some((valueWord) => includes(lowercaseRedundantWords, valueWord.toLowerCase()));
}
return lowercaseRedundantWords.some((redundantWord) => value.toLowerCase().includes(redundantWord));
}
Expand Down

0 comments on commit 7058725

Please sign in to comment.