Skip to content

Commit 7058725

Browse files
committed
[Fix]: Use of array-includes for env under es6
1 parent f270961 commit 7058725

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/rules/img-redundant-alt.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// ----------------------------------------------------------------------------
99

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

3233
if (isASCII) {
33-
return value.split(/\s+/).some((valueWord) => lowercaseRedundantWords.includes(valueWord.toLowerCase()));
34+
return value.split(/\s+/).some((valueWord) => includes(lowercaseRedundantWords, valueWord.toLowerCase()));
3435
}
3536
return lowercaseRedundantWords.some((redundantWord) => value.toLowerCase().includes(redundantWord));
3637
}

0 commit comments

Comments
 (0)