space-after-keywords: 2
## no leading/trailing spaces in parens
space-in-parens: [2, "never"]
+ ## no spaces with non-word unary operators, require for word unary operators
+ space-unary-ops: 2
# ECMAScript 6
# list: http://eslint.org/docs/rules/#ecmascript-6
Timeout.prototype.unref = function() {
if (this._handle) {
this._handle.unref();
- } else if (typeof(this._onTimeout) === 'function') {
+ } else if (typeof this._onTimeout === 'function') {
var now = Timer.now();
if (!this._idleStart) this._idleStart = now;
var delay = this._idleStart + this._idleTimeout - now;
getall();
function afterGC() {
- countGC ++;
+ countGC++;
}
var timer;
}
function afterGC() {
- countGC ++;
+ countGC++;
}
var timer;
getall();
function afterGC() {
- countGC ++;
+ countGC++;
}
var timer;
getall();
function afterGC() {
- countGC ++;
+ countGC++;
}
setInterval(status, 1000).unref();
getall();
function afterGC() {
- countGC ++;
+ countGC++;
}
setInterval(status, 100).unref();
// default encoding
exec('echo ' + str, function(err, stdout, stderr) {
- assert.ok('string', typeof(stdout), 'Expected stdout to be a string');
- assert.ok('string', typeof(stderr), 'Expected stderr to be a string');
+ assert.ok('string', typeof stdout, 'Expected stdout to be a string');
+ assert.ok('string', typeof stderr, 'Expected stderr to be a string');
assert.equal(str + os.EOL, stdout);
success_count++;
var file3 = fs.createReadStream(fn, Object.create({encoding: 'utf8'}));
file3.length = 0;
file3.on('data', function(data) {
- assert.equal('string', typeof(data));
+ assert.equal('string', typeof data);
file3.length += data.length;
for (var i = 0; i < data.length; i++) {
var file3 = fs.createReadStream(fn, {encoding: 'utf8'});
file3.length = 0;
file3.on('data', function(data) {
- assert.equal('string', typeof(data));
+ assert.equal('string', typeof data);
file3.length += data.length;
for (var i = 0; i < data.length; i++) {
res.on('finish', function() {
sawFinish = true;
- assert(typeof(req.connection.bytesWritten) === 'number');
+ assert(typeof req.connection.bytesWritten === 'number');
assert(req.connection.bytesWritten > 0);
});
res.writeHead(200, { 'Content-Type': 'text/plain' });
var testResBody = 'other stuff!\n';
var server = http.createServer(function(req, res) {
- assert.ok(! ('date' in req.headers),
+ assert.ok(!('date' in req.headers),
'Request headers contained a Date.');
res.writeHead(200, {
'Content-Type': 'text/plain'
c.on('end', function() {
c.end();
- assert.ok(! /x-foo/.test(res_buffer), 'Trailer in HTTP/1.0 response.');
+ assert.ok(!/x-foo/.test(res_buffer), 'Trailer in HTTP/1.0 response.');
outstanding_reqs--;
if (outstanding_reqs == 0) {
server.close();
var httpsServer = https.createServer(options, function(req, res) {
res.on('finish', function() {
- assert(typeof(req.connection.bytesWritten) === 'number');
+ assert(typeof req.connection.bytesWritten === 'number');
assert(req.connection.bytesWritten > 0);
httpsServer.close();
console.log('ok');
vm.runInDebugContext('(function(f) { f(f) })(function(f) { f(f) })');
}, /RangeError/);
-assert.equal(typeof(vm.runInDebugContext('this')), 'object');
-assert.equal(typeof(vm.runInDebugContext('Debug')), 'object');
+assert.equal(typeof vm.runInDebugContext('this'), 'object');
+assert.equal(typeof vm.runInDebugContext('Debug'), 'object');
assert.strictEqual(vm.runInDebugContext(), undefined);
assert.strictEqual(vm.runInDebugContext(0), 0);
// ensure that the port is not 0 or null
assert(port);
// ensure that the port is numerical
- assert.strictEqual(typeof(port), 'number');
+ assert.strictEqual(typeof port, 'number');
worker.kill();
});
process.on('exit', function() {