Skip to content
This repository was archived by the owner on Apr 2, 2024. It is now read-only.

Commit df5a466

Browse files
author
Alec Gibson
committed
Reset no-unused-vars linting rule to default
1 parent 3dfc938 commit df5a466

File tree

15 files changed

+77
-59
lines changed

15 files changed

+77
-59
lines changed

.eslintrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ const SHAREDB_RULES = {
2424
ignoreUrls: true,
2525
}
2626
],
27+
// Google overrides the default ESLint behaviour here, which is slightly better for catching erroneously unused variables
28+
'no-unused-vars': ['error', {vars: 'all', args: 'after-used'}],
2729
// as-needed quote props are easier to write
2830
'quote-props': ['error', 'as-needed'],
2931
'require-jsdoc': 'off',

examples/counter/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function startServer() {
2929

3030
// Connect any incoming WebSocket connection to ShareDB
3131
var wss = new WebSocket.Server({server: server});
32-
wss.on('connection', function(ws, req) {
32+
wss.on('connection', function(ws) {
3333
var stream = new WebSocketJSONStream(ws);
3434
backend.listen(stream);
3535
});

examples/leaderboard/server/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ server.listen(8080);
1818
console.log('Listening on http://localhost:8080');
1919

2020
// Connect any incoming WebSocket connection with ShareDB
21-
wss.on('connection', function(ws, req) {
21+
wss.on('connection', function(ws) {
2222
var stream = new WebSocketJSONStream(ws);
2323
share.listen(stream);
2424
});

examples/rich-text/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function startServer() {
3232

3333
// Connect any incoming WebSocket connection to ShareDB
3434
var wss = new WebSocket.Server({server: server});
35-
wss.on('connection', function(ws, req) {
35+
wss.on('connection', function(ws) {
3636
var stream = new WebSocketJSONStream(ws);
3737
backend.listen(stream);
3838
});

examples/textarea/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function startServer() {
2929

3030
// Connect any incoming WebSocket connection to ShareDB
3131
var wss = new WebSocket.Server({server: server});
32-
wss.on('connection', function(ws, req) {
32+
wss.on('connection', function(ws) {
3333
var stream = new WebSocketJSONStream(ws);
3434
backend.listen(stream);
3535
});

lib/db/memory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ MemoryDB.prototype.query = function(collection, query, fields, options, callback
122122
// two properties:
123123
// - snapshots: array of query result snapshots
124124
// - extra: (optional) other types of results, such as counts
125-
MemoryDB.prototype._querySync = function(snapshots, query, options) {
125+
MemoryDB.prototype._querySync = function(snapshots) {
126126
return {snapshots: snapshots};
127127
};
128128

test/client/number-type.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ function apply(snapshot, op) {
1818
return snapshot + op;
1919
}
2020

21-
function transform(op1, op2, side) {
21+
function transform(op1) {
2222
return op1;
2323
}

test/client/query-subscribe.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ module.exports = function(options) {
306306
if (err) return done(err);
307307
connection.get('dogs', 'fido').create({});
308308
});
309-
query.on('insert', function(docs, index) {
309+
query.on('insert', function(docs) {
310310
expect(util.pluck(docs, 'id')).eql(['fido']);
311311
done();
312312
});
@@ -320,7 +320,7 @@ module.exports = function(options) {
320320
if (err) return done(err);
321321
connection.get('dogs', 'fido').create({});
322322
});
323-
query.on('insert', function(docs, index) {
323+
query.on('insert', function(docs) {
324324
expect(util.pluck(docs, 'id')).eql(['fido']);
325325
done();
326326
});

test/client/snapshot-timestamp-request.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ describe('SnapshotTimestampRequest', function() {
227227
it('starts pending, and finishes not pending', function(done) {
228228
var connection = backend.connect();
229229

230-
connection.fetchSnapshotByTimestamp('books', 'time-machine', null, function(error, snapshot) {
230+
connection.fetchSnapshotByTimestamp('books', 'time-machine', null, function(error) {
231+
if (error) return done(error);
231232
expect(connection.hasPending()).to.be(false);
232233
done();
233234
});
@@ -357,7 +358,7 @@ describe('SnapshotTimestampRequest', function() {
357358
}
358359
];
359360

360-
backend.connect().fetchSnapshotByTimestamp('books', 'time-machine', day1, function(error, snapshot) {
361+
backend.connect().fetchSnapshotByTimestamp('books', 'time-machine', day1, function(error) {
361362
expect(error.message).to.be('foo');
362363
done();
363364
});

test/client/snapshot-version-request.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ describe('SnapshotVersionRequest', function() {
165165
it('starts pending, and finishes not pending', function(done) {
166166
var connection = backend.connect();
167167

168-
connection.fetchSnapshot('books', 'don-quixote', null, function(error, snapshot) {
168+
connection.fetchSnapshot('books', 'don-quixote', null, function(error) {
169+
if (error) return done(error);
169170
expect(connection.hasPending()).to.be(false);
170171
done();
171172
});
@@ -295,7 +296,7 @@ describe('SnapshotVersionRequest', function() {
295296
}
296297
];
297298

298-
backend.connect().fetchSnapshot('books', 'don-quixote', 0, function(error, snapshot) {
299+
backend.connect().fetchSnapshot('books', 'don-quixote', 0, function(error) {
299300
expect(error.message).to.be('foo');
300301
done();
301302
});

0 commit comments

Comments
 (0)