Merge pull request #15023 from Snuffleupagus/prefer-array-flat
Enable the `unicorn/prefer-array-flat` and `unicorn/prefer-array-flat-map` ESLint plugin rules
This commit is contained in:
commit
26ae50e449
@ -49,6 +49,8 @@
|
|||||||
"unicorn/no-new-buffer": "error",
|
"unicorn/no-new-buffer": "error",
|
||||||
"unicorn/no-instanceof-array": "error",
|
"unicorn/no-instanceof-array": "error",
|
||||||
"unicorn/no-useless-spread": "error",
|
"unicorn/no-useless-spread": "error",
|
||||||
|
"unicorn/prefer-array-flat": "error",
|
||||||
|
"unicorn/prefer-array-flat-map": "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",
|
||||||
|
@ -254,7 +254,7 @@ function searchNode(
|
|||||||
if (isFinite(index)) {
|
if (isFinite(index)) {
|
||||||
root = nodes.filter(node => index < node.length).map(node => node[index]);
|
root = nodes.filter(node => index < node.length).map(node => node[index]);
|
||||||
} else {
|
} else {
|
||||||
root = nodes.reduce((acc, node) => acc.concat(node), []);
|
root = nodes.flat();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user