From 8b88d605caddcef3c37aba671012bd569242155d Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 3 Feb 2023 11:42:25 +0100 Subject: [PATCH] benchmark: add trailing commas in `benchmark/util` PR-URL: https://github.com/nodejs/node/pull/46438 Reviewed-By: Moshe Atlow Reviewed-By: James M Snell --- benchmark/.eslintrc.yaml | 1 - benchmark/util/format.js | 2 +- benchmark/util/inspect-array.js | 2 +- benchmark/util/inspect-proxy.js | 2 +- benchmark/util/inspect.js | 4 ++-- benchmark/util/normalize-encoding.js | 6 +++--- benchmark/util/priority-queue.js | 2 +- benchmark/util/text-decoder.js | 2 +- benchmark/util/text-encoder.js | 2 +- benchmark/util/type-check.js | 12 ++++++------ 10 files changed, 17 insertions(+), 18 deletions(-) diff --git a/benchmark/.eslintrc.yaml b/benchmark/.eslintrc.yaml index 49c1da33358328..b6c0105f49f823 100644 --- a/benchmark/.eslintrc.yaml +++ b/benchmark/.eslintrc.yaml @@ -20,7 +20,6 @@ overrides: - path/*.js - process/*.js - url/*.js - - util/*.js rules: comma-dangle: [error, { arrays: always-multiline, diff --git a/benchmark/util/format.js b/benchmark/util/format.js index f7a6caa81c96b6..4078fe5e3da7cd 100644 --- a/benchmark/util/format.js +++ b/benchmark/util/format.js @@ -19,7 +19,7 @@ const inputs = { const bench = common.createBenchmark(main, { n: [1e5], - type: Object.keys(inputs) + type: Object.keys(inputs), }); function main({ n, type }) { diff --git a/benchmark/util/inspect-array.js b/benchmark/util/inspect-array.js index 958030d99bd192..7b2394d80e9cfe 100644 --- a/benchmark/util/inspect-array.js +++ b/benchmark/util/inspect-array.js @@ -11,7 +11,7 @@ const bench = common.createBenchmark(main, { 'sparseArray', 'mixedArray', 'denseArray_showHidden', - ] + ], }); function main({ n, len, type }) { diff --git a/benchmark/util/inspect-proxy.js b/benchmark/util/inspect-proxy.js index 02379cdc770f3b..23cac3282f0916 100644 --- a/benchmark/util/inspect-proxy.js +++ b/benchmark/util/inspect-proxy.js @@ -6,7 +6,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { n: [1e5], showProxy: [0, 1], - isProxy: [0, 1] + isProxy: [0, 1], }); function main({ n, showProxy, isProxy }) { diff --git a/benchmark/util/inspect.js b/benchmark/util/inspect.js index 0a19e65ea234be..ace4e588ae5135 100644 --- a/benchmark/util/inspect.js +++ b/benchmark/util/inspect.js @@ -6,7 +6,7 @@ const common = require('../common.js'); const opts = { showHidden: { showHidden: true }, colors: { colors: true }, - none: undefined + none: undefined, }; const bench = common.createBenchmark(main, { n: [2e4], @@ -25,7 +25,7 @@ const bench = common.createBenchmark(main, { 'TypedArray_extra', 'Number', ], - option: Object.keys(opts) + option: Object.keys(opts), }); function benchmark(n, obj, options) { diff --git a/benchmark/util/normalize-encoding.js b/benchmark/util/normalize-encoding.js index 03769cb3b229cb..cd65caca4a4056 100644 --- a/benchmark/util/normalize-encoding.js +++ b/benchmark/util/normalize-encoding.js @@ -9,7 +9,7 @@ const groupedInputs = { group_upper: ['UTF-8', 'UTF8', 'UCS2', 'UTF16LE', 'BASE64', 'UCS2'], group_uncommon: ['foo'], - group_misc: ['', 'utf16le', 'hex', 'HEX', 'BINARY'] + group_misc: ['', 'utf16le', 'hex', 'HEX', 'BINARY'], }; const inputs = [ @@ -21,9 +21,9 @@ const inputs = [ const bench = common.createBenchmark(main, { input: inputs.concat(Object.keys(groupedInputs)), - n: [1e5] + n: [1e5], }, { - flags: '--expose-internals' + flags: '--expose-internals', }); function getInput(input) { diff --git a/benchmark/util/priority-queue.js b/benchmark/util/priority-queue.js index ea4601a0021b9a..2301c5a1ef6892 100644 --- a/benchmark/util/priority-queue.js +++ b/benchmark/util/priority-queue.js @@ -3,7 +3,7 @@ const common = require('../common'); const bench = common.createBenchmark(main, { - n: [1e5] + n: [1e5], }, { flags: ['--expose-internals'] }); function main({ n, type }) { diff --git a/benchmark/util/text-decoder.js b/benchmark/util/text-decoder.js index a6695028603f8a..f85dd4db008ed8 100644 --- a/benchmark/util/text-decoder.js +++ b/benchmark/util/text-decoder.js @@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, { fatal: [0, 1], len: [256, 1024 * 16, 1024 * 512], n: [1e2], - type: ['SharedArrayBuffer', 'ArrayBuffer', 'Buffer'] + type: ['SharedArrayBuffer', 'ArrayBuffer', 'Buffer'], }); function main({ encoding, len, n, ignoreBOM, type, fatal }) { diff --git a/benchmark/util/text-encoder.js b/benchmark/util/text-encoder.js index 707f76df11dc89..1429710e9cbef5 100644 --- a/benchmark/util/text-encoder.js +++ b/benchmark/util/text-encoder.js @@ -6,7 +6,7 @@ const bench = common.createBenchmark(main, { len: [16, 32, 256, 1024, 1024 * 32], n: [1e4], type: ['one-byte-string', 'two-byte-string', 'ascii'], - op: ['encode', 'encodeInto'] + op: ['encode', 'encodeInto'], }); function main({ n, op, len, type }) { diff --git a/benchmark/util/type-check.js b/benchmark/util/type-check.js index 792f61cf6fb217..2bb956f4ed87ee 100644 --- a/benchmark/util/type-check.js +++ b/benchmark/util/type-check.js @@ -11,27 +11,27 @@ const args = { ArrayBufferView: { 'true': dataView, 'false-primitive': true, - 'false-object': arrayBuffer + 'false-object': arrayBuffer, }, TypedArray: { 'true': int32Array, 'false-primitive': true, - 'false-object': arrayBuffer + 'false-object': arrayBuffer, }, Uint8Array: { 'true': uint8Array, 'false-primitive': true, - 'false-object': int32Array - } + 'false-object': int32Array, + }, }; const bench = common.createBenchmark(main, { type: Object.keys(args), version: ['native', 'js'], argument: ['true', 'false-primitive', 'false-object'], - n: [1e5] + n: [1e5], }, { - flags: ['--expose-internals', '--no-warnings'] + flags: ['--expose-internals', '--no-warnings'], }); function main({ type, argument, version, n }) {