From 4cf3de8b0223d7ce5ea92721f566f608e096f5e8 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 20 Feb 2023 01:59:21 +0100 Subject: [PATCH] lib: add trailing commas in `internal/perf` PR-URL: https://github.com/nodejs/node/pull/46697 Reviewed-By: Moshe Atlow Reviewed-By: Darshan Sen Reviewed-By: James M Snell --- lib/.eslintrc.yaml | 1 + lib/internal/perf/event_loop_delay.js | 2 +- lib/internal/perf/nodetiming.js | 26 +++++++++++++------------- lib/internal/perf/observe.js | 4 ++-- lib/internal/perf/performance.js | 10 +++++----- lib/internal/perf/performance_entry.js | 4 ++-- lib/internal/perf/resource_timing.js | 2 +- lib/internal/perf/timerify.js | 8 ++++---- lib/internal/perf/utils.js | 2 +- 9 files changed, 30 insertions(+), 29 deletions(-) diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index db98082b52e7fd..a225fa36b3f658 100644 --- a/lib/.eslintrc.yaml +++ b/lib/.eslintrc.yaml @@ -275,6 +275,7 @@ overrides: - ./internal/mime.js - ./internal/modules/*.js - ./internal/per_context/messageport.js + - ./internal/perf/*.js - ./internal/policy/*.js - ./internal/priority_queue.js - ./internal/process/*.js diff --git a/lib/internal/perf/event_loop_delay.js b/lib/internal/perf/event_loop_delay.js index 18d7967477e0e4..1c1d657a9a0e61 100644 --- a/lib/internal/perf/event_loop_delay.js +++ b/lib/internal/perf/event_loop_delay.js @@ -9,7 +9,7 @@ const { codes: { ERR_ILLEGAL_CONSTRUCTOR, ERR_INVALID_THIS, - } + }, } = require('internal/errors'); const { diff --git a/lib/internal/perf/nodetiming.js b/lib/internal/perf/nodetiming.js index b0ab9df4473d63..11f877e5d81b44 100644 --- a/lib/internal/perf/nodetiming.js +++ b/lib/internal/perf/nodetiming.js @@ -25,7 +25,7 @@ const { NODE_PERFORMANCE_MILESTONE_LOOP_START, NODE_PERFORMANCE_MILESTONE_LOOP_EXIT, NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE, - NODE_PERFORMANCE_MILESTONE_ENVIRONMENT + NODE_PERFORMANCE_MILESTONE_ENVIRONMENT, }, loopIdleTime, } = internalBinding('performance'); @@ -37,28 +37,28 @@ class PerformanceNodeTiming { __proto__: null, enumerable: true, configurable: true, - value: 'node' + value: 'node', }, entryType: { __proto__: null, enumerable: true, configurable: true, - value: 'node' + value: 'node', }, startTime: { __proto__: null, enumerable: true, configurable: true, - value: 0 + value: 0, }, duration: { __proto__: null, enumerable: true, configurable: true, - get: now + get: now, }, nodeStart: { @@ -67,7 +67,7 @@ class PerformanceNodeTiming { configurable: true, get() { return getMilestoneTimestamp(NODE_PERFORMANCE_MILESTONE_NODE_START); - } + }, }, v8Start: { @@ -76,7 +76,7 @@ class PerformanceNodeTiming { configurable: true, get() { return getMilestoneTimestamp(NODE_PERFORMANCE_MILESTONE_V8_START); - } + }, }, environment: { @@ -85,7 +85,7 @@ class PerformanceNodeTiming { configurable: true, get() { return getMilestoneTimestamp(NODE_PERFORMANCE_MILESTONE_ENVIRONMENT); - } + }, }, loopStart: { @@ -94,7 +94,7 @@ class PerformanceNodeTiming { configurable: true, get() { return getMilestoneTimestamp(NODE_PERFORMANCE_MILESTONE_LOOP_START); - } + }, }, loopExit: { @@ -103,7 +103,7 @@ class PerformanceNodeTiming { configurable: true, get() { return getMilestoneTimestamp(NODE_PERFORMANCE_MILESTONE_LOOP_EXIT); - } + }, }, bootstrapComplete: { @@ -113,7 +113,7 @@ class PerformanceNodeTiming { get() { return getMilestoneTimestamp( NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE); - } + }, }, idleTime: { @@ -121,7 +121,7 @@ class PerformanceNodeTiming { enumerable: true, configurable: true, get: loopIdleTime, - } + }, }); } @@ -130,7 +130,7 @@ class PerformanceNodeTiming { const opts = { ...options, - depth: options.depth == null ? null : options.depth - 1 + depth: options.depth == null ? null : options.depth - 1, }; return `PerformanceNodeTiming ${inspect(this.toJSON(), opts)}`; diff --git a/lib/internal/perf/observe.js b/lib/internal/perf/observe.js index ca0b57a81bcc23..91067331aba2c4 100644 --- a/lib/internal/perf/observe.js +++ b/lib/internal/perf/observe.js @@ -202,7 +202,7 @@ class PerformanceObserverEntryList { const opts = { ...options, - depth: options.depth == null ? null : options.depth - 1 + depth: options.depth == null ? null : options.depth - 1, }; return `PerformanceObserverEntryList ${inspect(this.#buffer, opts)}`; @@ -327,7 +327,7 @@ class PerformanceObserver { const opts = { ...options, - depth: options.depth == null ? null : options.depth - 1 + depth: options.depth == null ? null : options.depth - 1, }; return `PerformanceObserver ${inspect({ diff --git a/lib/internal/perf/performance.js b/lib/internal/perf/performance.js index 54021b01440c98..af318b59e60c97 100644 --- a/lib/internal/perf/performance.js +++ b/lib/internal/perf/performance.js @@ -9,8 +9,8 @@ const { const { codes: { ERR_ILLEGAL_CONSTRUCTOR, - ERR_MISSING_ARGS - } + ERR_MISSING_ARGS, + }, } = require('internal/errors'); const { @@ -42,7 +42,7 @@ const { customInspectSymbol: kInspect } = require('internal/util'); const { inspect } = require('util'); const { - getTimeOriginTimestamp + getTimeOriginTimestamp, } = internalBinding('performance'); class Performance extends EventTarget { @@ -55,7 +55,7 @@ class Performance extends EventTarget { const opts = { ...options, - depth: options.depth == null ? null : options.depth - 1 + depth: options.depth == null ? null : options.depth - 1, }; return `Performance ${inspect({ @@ -237,7 +237,7 @@ const performance = new InternalPerformance(); function dispatchBufferFull(type) { const event = new Event(type, { - [kTrustEvent]: true + [kTrustEvent]: true, }); performance.dispatchEvent(event); } diff --git a/lib/internal/perf/performance_entry.js b/lib/internal/perf/performance_entry.js index 759f1315d5b6c2..8dbe96d7e194c6 100644 --- a/lib/internal/perf/performance_entry.js +++ b/lib/internal/perf/performance_entry.js @@ -8,7 +8,7 @@ const { const { codes: { ERR_ILLEGAL_CONSTRUCTOR, - } + }, } = require('internal/errors'); const { @@ -47,7 +47,7 @@ class PerformanceEntry { const opts = { ...options, - depth: options.depth == null ? null : options.depth - 1 + depth: options.depth == null ? null : options.depth - 1, }; return `${this.constructor.name} ${inspect(this.toJSON(), opts)}`; diff --git a/lib/internal/perf/resource_timing.js b/lib/internal/perf/resource_timing.js index 33e0d9e5ce936b..5c692c6b1f1557 100644 --- a/lib/internal/perf/resource_timing.js +++ b/lib/internal/perf/resource_timing.js @@ -15,7 +15,7 @@ const kInitiatorType = Symbol('kInitiatorType'); const { codes: { ERR_ILLEGAL_CONSTRUCTOR, - } + }, } = require('internal/errors'); class InternalPerformanceResourceTiming extends InternalPerformanceEntry { diff --git a/lib/internal/perf/timerify.js b/lib/internal/perf/timerify.js index e4c97e70353977..06bffeb300e034 100644 --- a/lib/internal/perf/timerify.js +++ b/lib/internal/perf/timerify.js @@ -17,7 +17,7 @@ const { } = require('internal/validators'); const { - isHistogram + isHistogram, } = require('internal/histogram'); const { @@ -57,7 +57,7 @@ function timerify(fn, options = kEmptyObject) { validateObject(options, 'options'); const { - histogram + histogram, } = options; if (histogram !== undefined && @@ -99,8 +99,8 @@ function timerify(fn, options = kEmptyObject) { __proto__: null, configurable: false, enumerable: true, - value: `timerified ${fn.name}` - } + value: `timerified ${fn.name}`, + }, }); return timerified; diff --git a/lib/internal/perf/utils.js b/lib/internal/perf/utils.js index bcc7e223b8c882..a92e177e4246e9 100644 --- a/lib/internal/perf/utils.js +++ b/lib/internal/perf/utils.js @@ -29,5 +29,5 @@ function refreshTimeOrigin() { module.exports = { now, getMilestoneTimestamp, - refreshTimeOrigin + refreshTimeOrigin, };