mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-18 14:18:23 +02:00
Merge pull request #19788 from Snuffleupagus/no-array-reduce
Enable the `no-array-reduce` ESLint plugin rule
This commit is contained in:
commit
0e50125a6c
2 changed files with 2 additions and 4 deletions
|
@ -127,6 +127,7 @@ export default [
|
|||
"perfectionist/sort-named-exports": "error",
|
||||
"unicorn/no-abusive-eslint-disable": "error",
|
||||
"unicorn/no-array-push-push": "error",
|
||||
"unicorn/no-array-reduce": ["error", { allowSimpleOperations: true }],
|
||||
"unicorn/no-console-spaces": "error",
|
||||
"unicorn/no-instanceof-builtins": "error",
|
||||
"unicorn/no-invalid-remove-event-listener": "error",
|
||||
|
|
|
@ -76,10 +76,7 @@ function pad(s, length, dir /* default: 'right' */) {
|
|||
}
|
||||
|
||||
function mean(array) {
|
||||
function add(a, b) {
|
||||
return a + b;
|
||||
}
|
||||
return array.reduce(add, 0) / array.length;
|
||||
return array.reduce((a, b) => a + b, 0) / array.length;
|
||||
}
|
||||
|
||||
/* Comparator for row key sorting. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue