Skip to content

Commit

Permalink
eslint: object-curly-spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
AlcaDesign committed Mar 12, 2021
1 parent 8c047ce commit 4b506dd
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 17 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"semi": 2,
"indent": [ 2, "tab", { "MemberExpression": 0, "SwitchCase": 1 } ],
"array-bracket-spacing": [ 2, "always" ],
"object-curly-spacing": [ 2, "always" ],
"constructor-super": 2,
"for-direction": 2,
"getter-return": 2,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"scripts": {
"test": "run-s eslint test:*",
"eslint": "eslint index.js lib/* test/*",
"eslint-fix": "eslint --fix index.js lib/* test/*",
"test:mocha": "nyc mocha -- --require should --exit",
"build": "run-s build:*",
"build:rimraf": "rimraf ./build",
Expand Down
2 changes: 1 addition & 1 deletion test/authentication.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var tests = [
describe('handling authentication', function() {
beforeEach(function() {
// Initialize websocket server
this.server = new WebSocketServer({port: 7000});
this.server = new WebSocketServer({ port: 7000 });
this.client = new tmi.client({
logger: {
error: noop,
Expand Down
14 changes: 7 additions & 7 deletions test/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,34 @@ describe("client()", function() {
});

it("uses the 'info' log when debug is set", function() {
var client = new tmi.client({options: {debug: true}});
var client = new tmi.client({ options: { debug: true } });
client.should.be.ok();
});

it("normalize channel names", function() {
var client = new tmi.client({channels: [ "avalonstar", "#dayvemsee" ]});
var client = new tmi.client({ channels: [ "avalonstar", "#dayvemsee" ] });
client.opts.channels.should.eql([ "#avalonstar", "#dayvemsee" ]);
});

it("should default secure to true when opts.connection.server and opts.connection.port not set", () => {
var client = new tmi.client();
client.secure.should.eql(true);
client = new tmi.client({connection: {}});
client = new tmi.client({ connection: {} });
client.secure.should.eql(true);
});
it("should default secure to false when opts.connection.server or opts.connection.port set", () => {
var client = new tmi.client({connection: {server: "localhost"}});
var client = new tmi.client({ connection: { server: "localhost" } });
client.secure.should.eql(false);
client = new tmi.client({connection: {port: 1}});
client = new tmi.client({ connection: { port: 1 } });
client.secure.should.eql(false);
client = new tmi.client({connection: {server: "localhost", port: 1}});
client = new tmi.client({ connection: { server: "localhost", port: 1 } });
client.secure.should.eql(false);
});
});

describe("client getters", function() {
it("gets options", function() {
var opts = {options: {debug: true}};
var opts = { options: { debug: true } };
var client = new tmi.client(opts);
client.getOptions().should.eql(opts);
});
Expand Down
4 changes: 2 additions & 2 deletions test/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ var tests = [ {
describe('commands (justinfan)', function() {
beforeEach(function() {
// Initialize websocket server
this.server = new WebSocketServer({port: 7000});
this.server = new WebSocketServer({ port: 7000 });
this.client = new tmi.client({
connection: {
server: 'localhost',
Expand Down Expand Up @@ -577,7 +577,7 @@ describe('commands (justinfan)', function() {
describe('commands (identity)', function() {
beforeEach(function() {
// Initialize websocket server
this.server = new WebSocketServer({port: 7000});
this.server = new WebSocketServer({ port: 7000 });
this.client = new tmi.client({
connection: {
server: 'localhost',
Expand Down
2 changes: 1 addition & 1 deletion test/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ describe('client events', function() {
cb();
});

client._onMessage({data: data});
client._onMessage({ data: data });
});
});

Expand Down
2 changes: 1 addition & 1 deletion test/invalid.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('invalid server events', function() {
}
});

client._onMessage({data: test});
client._onMessage({ data: test });
});
});
});
2 changes: 1 addition & 1 deletion test/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe("log()", function() {
it("logs to the console", function() {
var out = '';

var unhook = hookStd.stdout({silent: true}, function(output) {
var unhook = hookStd.stdout({ silent: true }, function(output) {
out += output;
});

Expand Down
2 changes: 1 addition & 1 deletion test/noop.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ describe('no-op server events', function() {
}
});

client._onMessage({data: test});
client._onMessage({ data: test });
});
});
});
6 changes: 3 additions & 3 deletions test/websockets.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var catchConnectError = err => {
describe('websockets', function() {
before(function() {
// Initialize websocket server
this.server = new WebSocketServer({port: 7000});
this.server = new WebSocketServer({ port: 7000 });
this.client = new tmi.client({
connection: {
server: 'localhost',
Expand Down Expand Up @@ -57,7 +57,7 @@ describe('websockets', function() {
describe('server crashed, with reconnect: false (default)', function() {
before(function() {
// Initialize websocket server
this.server = new WebSocketServer({port: 7000});
this.server = new WebSocketServer({ port: 7000 });
this.client = new tmi.client({
connection: {
server: 'localhost',
Expand Down Expand Up @@ -88,7 +88,7 @@ describe('server crashed, with reconnect: false (default)', function() {
describe('server crashed, with reconnect: true', function() {
before(function() {
// Initialize websocket server
this.server = new WebSocketServer({port: 7000});
this.server = new WebSocketServer({ port: 7000 });
this.client = new tmi.client({
connection: {
server: 'localhost',
Expand Down

0 comments on commit 4b506dd

Please sign in to comment.