Skip to content

Commit eca939d

Browse files
Merge pull request #15076 from Snuffleupagus/prefer-array-index-of
Enable the `prefer-array-index-of` ESLint plugin rule
2 parents c7a18bd + 1c9a702 commit eca939d

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

.eslintrc

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"unicorn/no-useless-spread": "error",
5252
"unicorn/prefer-array-flat": "error",
5353
"unicorn/prefer-array-flat-map": "error",
54+
"unicorn/prefer-array-index-of": "error",
5455
"unicorn/prefer-at": "error",
5556
"unicorn/prefer-date-now": "error",
5657
"unicorn/prefer-dom-node-append": "error",

src/core/xfa/template.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -5658,7 +5658,7 @@ class Template extends XFAObject {
56585658
// We must stop the contentAreas filling and go to the next page.
56595659
targetPageArea = target;
56605660
} else if (target instanceof ContentArea) {
5661-
const index = contentAreas.findIndex(e => e === target);
5661+
const index = contentAreas.indexOf(target);
56625662
if (index !== -1) {
56635663
if (index > currentIndex) {
56645664
// In the next loop iteration `i` will be incremented, note the
@@ -5671,9 +5671,7 @@ class Template extends XFAObject {
56715671
}
56725672
} else {
56735673
targetPageArea = target[$getParent]();
5674-
startIndex = targetPageArea.contentArea.children.findIndex(
5675-
e => e === target
5676-
);
5674+
startIndex = targetPageArea.contentArea.children.indexOf(target);
56775675
}
56785676
}
56795677
continue;

0 commit comments

Comments
 (0)