Skip to content

Commit

Permalink
tools: enable no-redeclare rule for linter
Browse files Browse the repository at this point in the history
PR-URL: #5047
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Michaël Zasso <mic.besace@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Trott authored and Myles Borins committed Feb 18, 2016
1 parent 1dae175 commit 6345acb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ rules:
# list: https://github.com/eslint/eslint/tree/master/docs/rules#best-practices
## require falls through comment on switch-case
no-fallthrough: 2
## disallow declaring the same variable more than once
no-redeclare: 2

# Stylistic Issues
# list: https://github.com/eslint/eslint/tree/master/docs/rules#stylistic-issues
Expand Down
2 changes: 1 addition & 1 deletion lib/dgram.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ Socket.prototype.send = function(buffer,
!!callback);
if (err && callback) {
// don't emit as error, dgram_legacy.js compatibility
var ex = exceptionWithHostPort(err, 'send', address, port);
const ex = exceptionWithHostPort(err, 'send', address, port);
process.nextTick(callback, ex);
}
}
Expand Down
10 changes: 5 additions & 5 deletions test/parallel/test-crypto-dh.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ assert.equal(bad_dh.verifyError, constants.DH_NOT_SUITABLE_GENERATOR);
// Test ECDH
var ecdh1 = crypto.createECDH('prime256v1');
var ecdh2 = crypto.createECDH('prime256v1');
var key1 = ecdh1.generateKeys();
var key2 = ecdh2.generateKeys('hex');
var secret1 = ecdh1.computeSecret(key2, 'hex', 'base64');
var secret2 = ecdh2.computeSecret(key1, 'binary', 'buffer');
key1 = ecdh1.generateKeys();
key2 = ecdh2.generateKeys('hex');
secret1 = ecdh1.computeSecret(key2, 'hex', 'base64');
secret2 = ecdh2.computeSecret(key1, 'binary', 'buffer');

assert.equal(secret1, secret2.toString('base64'));

Expand All @@ -168,7 +168,7 @@ crypto.createHash('sha256');
assert.equal(ecdh1.getPublicKey('buffer', 'uncompressed')[0], 4);
var firstByte = ecdh1.getPublicKey('buffer', 'compressed')[0];
assert(firstByte === 2 || firstByte === 3);
var firstByte = ecdh1.getPublicKey('buffer', 'hybrid')[0];
firstByte = ecdh1.getPublicKey('buffer', 'hybrid')[0];
assert(firstByte === 6 || firstByte === 7);

// ECDH should check that point is on curve
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-fs-utimes.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function stat_resource(resource) {
}

function check_mtime(resource, mtime) {
var mtime = fs._toUnixTimestamp(mtime);
mtime = fs._toUnixTimestamp(mtime);
var stats = stat_resource(resource);
var real_mtime = fs._toUnixTimestamp(stats.mtime);
// check up to single-second precision
Expand Down

0 comments on commit 6345acb

Please sign in to comment.