Skip to content

Commit a4972af

Browse files
committed
Linting and tests update
1 parent d578e16 commit a4972af

File tree

10 files changed

+365
-714
lines changed

10 files changed

+365
-714
lines changed

.jshintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
"latedef": "nofunc",
66
"noarg": true,
77
"undef": true,
8-
"unused": true
8+
"unused": false,
9+
"esnext": true
910
}

examples/bot.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var IRC = require('../');
88
function NickservMiddleware() {
99
return function(client, raw_events, parsed_events) {
1010
raw_events.use(theMiddleware);
11-
}
11+
};
1212

1313

1414
function theMiddleware(command, event, client, next) {
@@ -33,7 +33,7 @@ function MyIrcMiddleware() {
3333
return function(client, raw_events, parsed_events) {
3434
parsed_events.use(theMiddleware);
3535
client.requestCap('kiwiirc.com/user');
36-
}
36+
};
3737

3838

3939
function theMiddleware(command, event, client, next) {

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"description": "A better IRC framework for node.js",
55
"main": "index.js",
66
"dependencies": {
7-
"es6-set": "^0.1.3",
87
"eventemitter3": "^2.0.2",
98
"iconv-lite": "^0.4.11",
109
"lodash": "^3.10.1",

src/commands/handlers/registration.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ var handlers = {
6060

6161
CAP: function(command) {
6262
var request_caps = [];
63-
var capabilities = [];
6463
var capability_values = Object.create(null);
6564

6665
// TODO: capability modifiers

src/connection.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,15 @@ Connection.prototype.write = function(data, callback) {
170170
Connection.prototype.setTimeout = function(/*fn, length, argN */) {
171171
var that = this;
172172
var tmr = null;
173-
var callback = arguments[0];
173+
var args = Array.prototype.slice.call(arguments, 0);
174+
var callback = args[0];
174175

175-
arguments[0] = function() {
176+
args[0] = function() {
176177
_.pull(that._timers, tmr);
177-
callback.apply(null, arguments);
178+
callback.apply(null, args);
178179
};
179180

180-
tmr = setTimeout.apply(null, arguments);
181+
tmr = setTimeout.apply(null, args);
181182
this._timers.push(tmr);
182183
return tmr;
183184
};
@@ -242,7 +243,7 @@ Connection.prototype.processReadBuffer = function(continue_processing) {
242243
}
243244

244245
var that = this;
245-
var lines_per_js_tick = 4;
246+
var lines_per_js_tick = 40;
246247
var processed_lines = 0;
247248
var line;
248249
var message;

src/transports/websocket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Connection.prototype.connect = function() {
5454
ws_addr += options.port ? ':' + options.port : '';
5555
ws_addr += options.path ? options.path : '';
5656

57-
socket = this.socket = new WebSocket(ws_addr);
57+
socket = this.socket = new WebSocket(ws_addr); // jshint ignore:line
5858

5959
socket.onopen = _.bind(function() {
6060
that.onSocketFullyConnected();

src/user.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
var Set = require('es6-set');
2-
31
function User(opts) {
42
opts = opts || {};
53

test/commands/handlers/misc.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/*globals describe, it */
2+
/* jshint -W024 */
3+
/* jshint expr:true */
24
var chai = require('chai'),
35
expect = chai.expect,
46
mocks = require('../../mocks'),

test/helper.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"use strict";
2+
/*globals describe, it */
23
let chai = require('chai'),
3-
Helper = require('../src/helper'),
4+
Helper = require('../src/helpers'),
45
expect = chai.expect;
56

67
chai.use(require('chai-subset'));

0 commit comments

Comments
 (0)