mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
tools: enable no-redeclare rule for linter
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
1 parent
1dae175b62
commit
6345acb792
4 files changed
+9
-7
No files matched your search
@@ -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
|
||||
|
||||
+1
-1
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'));
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user