diff --git a/.eslintrc.js b/.eslintrc.js index a4439d7ab23d8e..5ea4d0b086b6cc 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -214,6 +214,7 @@ module.exports = { 'no-unsafe-finally': 'error', 'no-whitespace-before-property': 'error', 'object-curly-spacing': ['error', 'always'], + 'one-var': ['error', { initialized: 'never' }], 'one-var-declaration-per-line': 'error', 'operator-linebreak': ['error', 'after'], quotes: ['error', 'single', 'avoid-escape'], diff --git a/benchmark/tls/tls-connect.js b/benchmark/tls/tls-connect.js index da0f5e08d5e6db..524d7468d000a1 100644 --- a/benchmark/tls/tls-connect.js +++ b/benchmark/tls/tls-connect.js @@ -1,7 +1,7 @@ 'use strict'; -var fs = require('fs'), - path = require('path'), - tls = require('tls'); +const fs = require('fs'); +const path = require('path'); +const tls = require('tls'); const common = require('../common.js'); const bench = common.createBenchmark(main, { diff --git a/test/parallel/test-cluster-worker-kill.js b/test/parallel/test-cluster-worker-kill.js index 38e2deb1555c2d..bb2d3495d95a4d 100644 --- a/test/parallel/test-cluster-worker-kill.js +++ b/test/parallel/test-cluster-worker-kill.js @@ -40,29 +40,28 @@ if (cluster.isWorker) { } else if (cluster.isMaster) { - const KILL_SIGNAL = 'SIGKILL', - expected_results = { - cluster_emitDisconnect: [1, "the cluster did not emit 'disconnect'"], - cluster_emitExit: [1, "the cluster did not emit 'exit'"], - cluster_exitCode: [null, 'the cluster exited w/ incorrect exitCode'], - cluster_signalCode: [KILL_SIGNAL, - 'the cluster exited w/ incorrect signalCode'], - worker_emitDisconnect: [1, "the worker did not emit 'disconnect'"], - worker_emitExit: [1, "the worker did not emit 'exit'"], - worker_state: ['disconnected', 'the worker state is incorrect'], - worker_exitedAfter: [false, - 'the .exitedAfterDisconnect flag is incorrect'], - worker_died: [true, 'the worker is still running'], - worker_exitCode: [null, 'the worker exited w/ incorrect exitCode'], - worker_signalCode: [KILL_SIGNAL, - 'the worker exited w/ incorrect signalCode'] - }, - results = { - cluster_emitDisconnect: 0, - cluster_emitExit: 0, - worker_emitDisconnect: 0, - worker_emitExit: 0 - }; + const KILL_SIGNAL = 'SIGKILL'; + const expected_results = { + cluster_emitDisconnect: [1, "the cluster did not emit 'disconnect'"], + cluster_emitExit: [1, "the cluster did not emit 'exit'"], + cluster_exitCode: [null, 'the cluster exited w/ incorrect exitCode'], + cluster_signalCode: [KILL_SIGNAL, + 'the cluster exited w/ incorrect signalCode'], + worker_emitDisconnect: [1, "the worker did not emit 'disconnect'"], + worker_emitExit: [1, "the worker did not emit 'exit'"], + worker_state: ['disconnected', 'the worker state is incorrect'], + worker_exitedAfter: [false, 'the .exitedAfterDisconnect flag is incorrect'], + worker_died: [true, 'the worker is still running'], + worker_exitCode: [null, 'the worker exited w/ incorrect exitCode'], + worker_signalCode: [KILL_SIGNAL, + 'the worker exited w/ incorrect signalCode'] + }; + const results = { + cluster_emitDisconnect: 0, + cluster_emitExit: 0, + worker_emitDisconnect: 0, + worker_emitExit: 0 + }; // start worker