Enable the prefer-array-index-of
ESLint plugin rule
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-index-of.md
This commit is contained in:
parent
05cab5c17d
commit
1c9a702f73
@ -51,6 +51,7 @@
|
|||||||
"unicorn/no-useless-spread": "error",
|
"unicorn/no-useless-spread": "error",
|
||||||
"unicorn/prefer-array-flat": "error",
|
"unicorn/prefer-array-flat": "error",
|
||||||
"unicorn/prefer-array-flat-map": "error",
|
"unicorn/prefer-array-flat-map": "error",
|
||||||
|
"unicorn/prefer-array-index-of": "error",
|
||||||
"unicorn/prefer-at": "error",
|
"unicorn/prefer-at": "error",
|
||||||
"unicorn/prefer-date-now": "error",
|
"unicorn/prefer-date-now": "error",
|
||||||
"unicorn/prefer-dom-node-append": "error",
|
"unicorn/prefer-dom-node-append": "error",
|
||||||
|
@ -5658,7 +5658,7 @@ class Template extends XFAObject {
|
|||||||
// We must stop the contentAreas filling and go to the next page.
|
// We must stop the contentAreas filling and go to the next page.
|
||||||
targetPageArea = target;
|
targetPageArea = target;
|
||||||
} else if (target instanceof ContentArea) {
|
} else if (target instanceof ContentArea) {
|
||||||
const index = contentAreas.findIndex(e => e === target);
|
const index = contentAreas.indexOf(target);
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
if (index > currentIndex) {
|
if (index > currentIndex) {
|
||||||
// In the next loop iteration `i` will be incremented, note the
|
// In the next loop iteration `i` will be incremented, note the
|
||||||
@ -5671,9 +5671,7 @@ class Template extends XFAObject {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
targetPageArea = target[$getParent]();
|
targetPageArea = target[$getParent]();
|
||||||
startIndex = targetPageArea.contentArea.children.findIndex(
|
startIndex = targetPageArea.contentArea.children.indexOf(target);
|
||||||
e => e === target
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user