Skip to content

Commit 4c6ba65

Browse files
committed
removed unnecesary comments and corrected styling for new eslint
Signed-off-by: itavy <itavyg@gmail.com>
1 parent 84a3cb8 commit 4c6ba65

File tree

8 files changed

+79
-74
lines changed

8 files changed

+79
-74
lines changed

.eslintrc

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,15 @@
1313
0,
1414
false
1515
],
16-
"no-underscore-dangle": [
17-
0,
18-
false
19-
],
16+
"no-underscore-dangle": 0,
2017
"yoda": [
2118
1,
2219
"always"
2320
],
2421
"indent": [
2522
2,
26-
2
23+
2,
24+
{"SwitchCase": 1}
2725
],
2826
"brace-style": [
2927
2,
@@ -43,7 +41,7 @@
4341
"no-nested-ternary": 2,
4442
"no-undefined": 2,
4543
"radix": 2,
46-
"space-after-function-name": [
44+
"space-before-function-paren": [
4745
1,
4846
"always"
4947
],
@@ -52,21 +50,26 @@
5250
"always"
5351
],
5452
"space-before-blocks": 2,
55-
"spaced-line-comment": [
53+
"spaced-comment": [
5654
2,
5755
"always",
5856
{
5957
"exceptions": [
6058
"-"
61-
]
59+
],
60+
"markers": [
61+
"eslint",
62+
"jshint",
63+
"global"
64+
]
6265
}
6366
],
6467
"strict": [
6568
2,
6669
"global"
6770
],
6871
"wrap-iife": 2,
69-
"camelcase": false,
70-
"new-cap": false
72+
"camelcase": 0,
73+
"new-cap": 0
7174
}
7275
}

test/abstract_client.js

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ module.exports = function (server, config) {
216216
client.once('connect', function () {
217217
done(new Error('Should not emit connect'));
218218
});
219-
client.once('error', function (/*error*/) {
219+
client.once('error', function (/* error */) {
220220
// to do
221221
// check for error message
222222
// and validate it is the expected one
@@ -263,7 +263,7 @@ module.exports = function (server, config) {
263263

264264
server.once('client', function (serverClient) {
265265
serverClient.on('subscribe', function () {
266-
serverClient.on('publish', function (/*packet*/) {
266+
serverClient.on('publish', function () {
267267
done();
268268
});
269269
});
@@ -311,7 +311,7 @@ module.exports = function (server, config) {
311311
client.publish('test', 'test', { qos: 1 }, function () {
312312
client.end();
313313
});
314-
client.on('message', function (/*t, p, packet*/) {
314+
client.on('message', function () {
315315
done();
316316
});
317317
});
@@ -566,7 +566,7 @@ module.exports = function (server, config) {
566566

567567
it('should checkPing at keepalive interval', function (done) {
568568
var interval = 3,
569-
client = connect({keepalive: interval});
569+
client = connect({keepalive: interval});
570570

571571
client._checkPing = sinon.spy();
572572

@@ -634,7 +634,7 @@ module.exports = function (server, config) {
634634
client.subscribe('test');
635635

636636
server.once('client', function (serverClient) {
637-
serverClient.once('subscribe', function (/*packet*/) {
637+
serverClient.once('subscribe', function () {
638638
done();
639639
});
640640
});
@@ -663,7 +663,7 @@ module.exports = function (server, config) {
663663
var client = connect(),
664664
subs = ['test1', 'test2'];
665665

666-
client.once('connect', function (/*args*/) {
666+
client.once('connect', function () {
667667
client.subscribe(subs);
668668
});
669669

@@ -713,7 +713,7 @@ module.exports = function (server, config) {
713713
topic = 'test',
714714
opts = {qos: 1};
715715

716-
client.once('connect', function (/*args*/) {
716+
client.once('connect', function () {
717717
client.subscribe(topic, opts);
718718
});
719719

@@ -731,7 +731,7 @@ module.exports = function (server, config) {
731731
var client = connect(),
732732
topic = 'test';
733733

734-
client.once('connect', function (/*args*/) {
734+
client.once('connect', function () {
735735
client.subscribe(topic, {qos: 2}, function (err, granted) {
736736
if (err) {
737737
done(err);
@@ -785,7 +785,7 @@ module.exports = function (server, config) {
785785
});
786786

787787
server.once('client', function (serverClient) {
788-
serverClient.on('subscribe', function (/*packet*/) {
788+
serverClient.on('subscribe', function () {
789789
serverClient.publish(testPacket);
790790
});
791791
});
@@ -794,12 +794,12 @@ module.exports = function (server, config) {
794794
it('should support binary data', function (done) {
795795
var client = connect({ encoding: 'binary' }),
796796
testPacket = {
797-
topic: 'test',
798-
payload: 'message',
799-
retain: true,
800-
qos: 1,
801-
messageId: 5
802-
};
797+
topic: 'test',
798+
payload: 'message',
799+
retain: true,
800+
qos: 1,
801+
messageId: 5
802+
};
803803

804804
client.subscribe(testPacket.topic);
805805
client.once('message',
@@ -812,7 +812,7 @@ module.exports = function (server, config) {
812812
});
813813

814814
server.once('client', function (serverClient) {
815-
serverClient.on('subscribe', function (/*packet*/) {
815+
serverClient.on('subscribe', function () {
816816
serverClient.publish(testPacket);
817817
});
818818
});
@@ -840,7 +840,7 @@ module.exports = function (server, config) {
840840
});
841841

842842
server.once('client', function (serverClient) {
843-
serverClient.on('subscribe', function (/*packet*/) {
843+
serverClient.on('subscribe', function () {
844844
serverClient.publish(testPacket);
845845
});
846846
});
@@ -868,7 +868,7 @@ module.exports = function (server, config) {
868868
});
869869

870870
server.once('client', function (serverClient) {
871-
serverClient.on('subscribe', function (/*packet*/) {
871+
serverClient.on('subscribe', function () {
872872
serverClient.publish(testPacket);
873873
// twice, should be ignored
874874
serverClient.publish(testPacket);
@@ -879,12 +879,12 @@ module.exports = function (server, config) {
879879
it('should support chinese topic', function (done) {
880880
var client = connect({ encoding: 'binary' }),
881881
testPacket = {
882-
topic: '国',
883-
payload: 'message',
884-
retain: true,
885-
qos: 1,
886-
messageId: 5
887-
};
882+
topic: '国',
883+
payload: 'message',
884+
retain: true,
885+
qos: 1,
886+
messageId: 5
887+
};
888888

889889
client.subscribe(testPacket.topic);
890890
client.once('message',
@@ -897,7 +897,7 @@ module.exports = function (server, config) {
897897
});
898898

899899
server.once('client', function (serverClient) {
900-
serverClient.on('subscribe', function (/*packet*/) {
900+
serverClient.on('subscribe', function () {
901901
serverClient.publish(testPacket);
902902
});
903903
});
@@ -916,7 +916,7 @@ module.exports = function (server, config) {
916916
});
917917

918918
server.once('client', function (serverClient) {
919-
serverClient.once('subscribe', function (/*packet*/) {
919+
serverClient.once('subscribe', function () {
920920
serverClient.publish({
921921
topic: test_topic,
922922
payload: test_message,
@@ -934,12 +934,12 @@ module.exports = function (server, config) {
934934
test_message = 'message',
935935
mid = 50;
936936

937-
client.once('connect', function (/*args*/) {
937+
client.once('connect', function () {
938938
client.subscribe(test_topic, {qos: 1});
939939
});
940940

941941
server.once('client', function (serverClient) {
942-
serverClient.once('subscribe', function (/*packet*/) {
942+
serverClient.once('subscribe', function () {
943943
serverClient.publish({
944944
topic: test_topic,
945945
payload: test_message,
@@ -966,7 +966,7 @@ module.exports = function (server, config) {
966966
});
967967

968968
server.once('client', function (serverClient) {
969-
serverClient.once('subscribe', function (/*packet*/) {
969+
serverClient.once('subscribe', function () {
970970
serverClient.publish({
971971
topic: test_topic,
972972
payload: test_message,
@@ -975,7 +975,7 @@ module.exports = function (server, config) {
975975
});
976976
});
977977

978-
serverClient.once('pubcomp', function (/*packet*/) {
978+
serverClient.once('pubcomp', function () {
979979
done();
980980
});
981981
});

test/abstract_store.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ module.exports = function abstractStoreTest (build) {
6161
store.del(packet, function () {
6262
store
6363
.createStream()
64-
.on('data', function (/*data*/) {
64+
.on('data', function () {
6565
done(new Error('this should never happen'));
6666
})
6767
.on('end', done);
@@ -71,11 +71,11 @@ module.exports = function abstractStoreTest (build) {
7171

7272
it('should replace a packet when doing put with the same messageId', function (done) {
7373
var packet1 = {
74-
topic: 'hello',
75-
payload: 'world',
76-
qos: 2,
77-
messageId: 42
78-
},
74+
topic: 'hello',
75+
payload: 'world',
76+
qos: 2,
77+
messageId: 42
78+
},
7979
packet2 = {
8080
qos: 2,
8181
messageId: 42

test/browser/server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ handleClient = function (client) {
7070
client.pubrel(packet);
7171
});
7272

73-
client.on('pubcomp', function (/*packet*/) {
73+
client.on('pubcomp', function () {
7474
// Nothing to be done
7575
});
7676

@@ -94,7 +94,7 @@ handleClient = function (client) {
9494
client.unsuback(packet);
9595
});
9696

97-
client.on('pingreq', function (/*packet*/) {
97+
client.on('pingreq', function () {
9898
client.pingresp();
9999
});
100100
};

test/client.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function buildServer () {
5757
client.pubrel(packet);
5858
});
5959

60-
client.on('pubcomp', function (/*packet*/) {
60+
client.on('pubcomp', function () {
6161
// Nothing to be done
6262
});
6363

@@ -74,7 +74,7 @@ function buildServer () {
7474
client.unsuback(packet);
7575
});
7676

77-
client.on('pingreq', function (/*packet*/) {
77+
client.on('pingreq', function () {
7878
client.pingresp();
7979
});
8080
});
@@ -233,11 +233,12 @@ describe('MqttClient', function () {
233233
this.timeout(2500);
234234

235235
var server2 = buildServer().listen(port + 45),
236-
client = mqtt.connect({
237-
port: port + 45,
238-
host: 'localhost',
239-
connectTimeout: 350,
240-
reconnectPeriod: 300 });
236+
client = mqtt.connect({
237+
port: port + 45,
238+
host: 'localhost',
239+
connectTimeout: 350,
240+
reconnectPeriod: 300
241+
});
241242

242243
server2.on('client', function (c) {
243244
client.publish('hello', 'world', { qos: 1 }, function () {

0 commit comments

Comments
 (0)