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

Commit de9926a

Browse files
committed
chore(lint): fix no-unused-vars errors
1 parent 237d1ec commit de9926a

File tree

11 files changed

+29
-26
lines changed

11 files changed

+29
-26
lines changed

.eslintrc.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ module.exports = {
99
],
1010
rules: {
1111
'no-shadow': 'error',
12-
'no-unused-vars': 'warn'
12+
'no-unused-vars': ['error', {
13+
argsIgnorePattern: '^_',
14+
caughtErrorsIgnorePattern: '^_'
15+
}]
1316
}
1417
}

lib/client/client.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ Client.prototype.starttls = function starttls (options,
697697
self._starttls = null
698698
callback(err)
699699
})
700-
emitter.on('end', function (res) {
700+
emitter.on('end', function (_res) {
701701
const sock = self._socket
702702
/*
703703
* Unplumb socket data during SSL negotiation.
@@ -938,7 +938,7 @@ Client.prototype.connect = function connect () {
938938
f(basicClient, callback)
939939
},
940940
inputs: self.listeners('setup')
941-
}, function (err, res) {
941+
}, function (err, _res) {
942942
if (err) {
943943
self.emit('setupError', err)
944944
}
@@ -1001,7 +1001,7 @@ Client.prototype.connect = function connect () {
10011001
}
10021002
retry.failAfter(failAfter)
10031003

1004-
retry.on('ready', function (num, delay) {
1004+
retry.on('ready', function (num, _delay) {
10051005
if (self.destroyed) {
10061006
// Cease connection attempts if destroyed
10071007
return

lib/client/search_pager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ SearchPager.prototype._nextPage = function _nextPage (cookie) {
150150
/**
151151
* Callback provided to the client API for successful transmission.
152152
*/
153-
SearchPager.prototype._sendCallback = function _sendCallback (err, res) {
153+
SearchPager.prototype._sendCallback = function _sendCallback (err) {
154154
if (err) {
155155
this.finished = true
156156
if (!this.started) {

lib/messages/abandon_response.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Object.defineProperties(AbandonResponse.prototype, {
2323
}
2424
})
2525

26-
AbandonResponse.prototype.end = function (status) {}
26+
AbandonResponse.prototype.end = function (_status) {}
2727

2828
AbandonResponse.prototype._json = function (j) {
2929
return j

lib/messages/search_entry.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Object.defineProperties(SearchEntry.prototype, {
5454
obj[a.type] = []
5555
}
5656
})
57-
this.controls.forEach(function (element, index, array) {
57+
this.controls.forEach(function (element) {
5858
obj.controls.push(element.json)
5959
})
6060
return obj
@@ -79,7 +79,7 @@ Object.defineProperties(SearchEntry.prototype, {
7979
obj[a.type] = []
8080
}
8181
})
82-
this.controls.forEach(function (element, index, array) {
82+
this.controls.forEach(function (element) {
8383
obj.controls.push(element.json)
8484
})
8585
return obj

lib/messages/unbind_response.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ Object.defineProperties(UnbindResponse.prototype, {
3131
/**
3232
* Special override that just ends the connection, if present.
3333
*
34-
* @param {Number} status completely ignored.
34+
* @param {Number} _status completely ignored.
3535
*/
36-
UnbindResponse.prototype.end = function (status) {
36+
UnbindResponse.prototype.end = function (_status) {
3737
assert.ok(this.connection)
3838

3939
this.log.trace('%s: unbinding!', this.connection.ldap.id)

lib/persistent_search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function getOperationType (requestType) {
7777
}
7878
}
7979

80-
function getEntryChangeNotificationControl (req, obj, callback) {
80+
function getEntryChangeNotificationControl (req, obj) {
8181
// if we want to return a ECNC
8282
if (req.persistentSearch.value.returnECs) {
8383
const attrs = obj.attributes

test-integration/client/issues.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ tap.test('modifyDN with long name (issue #480)', t => {
3232
client.modifyDN(
3333
`cn=${longStr},ou=people,dc=planetexpress,dc=com`,
3434
targetDN,
35-
(err, res) => {
35+
(err) => {
3636
t.error(err)
3737
client.unbind(t.end)
3838
}

test/client.test.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ tap.beforeEach((done, t) => {
7979
}, 250)
8080
})
8181

82-
server.search('dc=timeout', function (req, res, next) {
82+
server.search('dc=timeout', function () {
8383
// Cause the client to timeout by not sending a response.
8484
})
8585

@@ -721,13 +721,13 @@ tap.test('GH-602 search basic with delayed event listener binding', function (t)
721721
t.error(err)
722722
setTimeout(() => {
723723
let gotEntry = 0
724-
res.on('searchEntry', function (entry) {
724+
res.on('searchEntry', function () {
725725
gotEntry++
726726
})
727727
res.on('error', function (err) {
728728
t.fail(err)
729729
})
730-
res.on('end', function (res) {
730+
res.on('end', function () {
731731
t.equal(gotEntry, 2)
732732
t.end()
733733
})
@@ -751,7 +751,7 @@ tap.test('search sizeLimit', function (t) {
751751
t.context.client.search('cn=sizelimit', { sizeLimit: limit }, function (err, res) {
752752
t2.error(err)
753753
let count = 0
754-
res.on('searchEntry', function (entry) {
754+
res.on('searchEntry', function () {
755755
count++
756756
})
757757
res.on('end', function () {
@@ -991,7 +991,7 @@ tap.test('search - sssvlv', { timeout: 10000 }, function (t) {
991991
count++
992992
})
993993
res.on('error', (err) => t2.error(err))
994-
res.on('end', function (result) {
994+
res.on('end', function () {
995995
t2.equals(count, 10)
996996
t2.end()
997997
})
@@ -1033,7 +1033,7 @@ tap.test('search - sssvlv', { timeout: 10000 }, function (t) {
10331033
count++
10341034
})
10351035
res.on('error', (err) => t2.error(err))
1036-
res.on('end', function (result) {
1036+
res.on('end', function () {
10371037
t2.equals(count, 10)
10381038
t2.end()
10391039
})
@@ -1048,7 +1048,7 @@ tap.test('search referral', function (t) {
10481048
t.ok(res)
10491049
let gotEntry = 0
10501050
let gotReferral = false
1051-
res.on('searchEntry', function (entry) {
1051+
res.on('searchEntry', function () {
10521052
gotEntry++
10531053
})
10541054
res.on('searchReference', function (referral) {
@@ -1261,7 +1261,7 @@ tap.test('setup action', function (t) {
12611261
socketPath: t.context.socketPath
12621262
})
12631263
setupClient.on('setup', function (clt, cb) {
1264-
clt.bind(BIND_DN, BIND_PW, function (err, res) {
1264+
clt.bind(BIND_DN, BIND_PW, function (err) {
12651265
t.error(err)
12661266
cb(err)
12671267
})
@@ -1283,7 +1283,7 @@ tap.test('setup reconnect', function (t) {
12831283
reconnect: true
12841284
})
12851285
rClient.on('setup', function (clt, cb) {
1286-
clt.bind(BIND_DN, BIND_PW, function (err, res) {
1286+
clt.bind(BIND_DN, BIND_PW, function (err) {
12871287
t.error(err)
12881288
cb(err)
12891289
})
@@ -1402,7 +1402,7 @@ tap.test('reconnect on server close', function (t) {
14021402
reconnect: true
14031403
})
14041404
clt.on('setup', function (sclt, cb) {
1405-
sclt.bind(BIND_DN, BIND_PW, function (err, res) {
1405+
sclt.bind(BIND_DN, BIND_PW, function (err) {
14061406
t.error(err)
14071407
cb(err)
14081408
})
@@ -1426,7 +1426,7 @@ tap.test('no auto-reconnect on unbind', function (t) {
14261426
reconnect: true
14271427
})
14281428
clt.on('setup', function (sclt, cb) {
1429-
sclt.bind(BIND_DN, BIND_PW, function (err, res) {
1429+
sclt.bind(BIND_DN, BIND_PW, function (err) {
14301430
t.error(err)
14311431
cb(err)
14321432
})

test/laundry.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ tap.beforeEach((done, t) => {
3434
return next()
3535
})
3636

37-
server.search(suffix, function (req, res, next) {
37+
server.search(suffix, function (req, res) {
3838
const entry = {
3939
dn: 'cn=foo, ' + suffix,
4040
attributes: {

0 commit comments

Comments
 (0)