Skip to content

Commit

Permalink
tools: enable eslint one-var rule
Browse files Browse the repository at this point in the history
PR-URL: nodejs#18831
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Matheus Marchini <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
BridgeAR committed Feb 22, 2018
1 parent cbc6f39 commit 8be9657
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down
6 changes: 3 additions & 3 deletions benchmark/tls/tls-connect.js
Original file line number Diff line number Diff line change
@@ -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, {
Expand Down
45 changes: 22 additions & 23 deletions test/parallel/test-cluster-worker-kill.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8be9657

Please sign in to comment.