Skip to content

Commit 34225c7

Browse files
committed
chore manual eslint fixes
1 parent f7e8846 commit 34225c7

8 files changed

Lines changed: 20 additions & 16 deletions

File tree

dev-utils/bitrot.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ function loadSupportedDoc () {
136136
var state = null // null | 'thead' | 'tbody'
137137
html.split(/\n/g).forEach(function (line) {
138138
if (!line.startsWith('|')) {
139-
139+
// no op
140140
} else if (state === null) {
141141
if (line.startsWith('|===')) {
142142
state = 'thead'
@@ -181,7 +181,7 @@ function loadSupportedDoc () {
181181
let match
182182
rows.forEach(function (row) {
183183
if (row[1] === 'N/A') {
184-
184+
// skip
185185
} else if (row[0].includes('<<')) {
186186
match = /^\s*<<([\w-]+),(.*?)>>/.exec(row[0])
187187
if (!match) {

lib/instrumentation/modules/elasticsearch.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ function getTargetUrlFromTransportConfig (config) {
2929
}
3030

3131
let firstTransportHost = Array.isArray(transportHosts)
32-
? transportHosts[0] : transportHosts
32+
? transportHosts[0]
33+
: transportHosts
3334
if (!firstTransportHost) {
3435
return null
3536
}

lib/instrumentation/modules/mysql.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ module.exports = function (mysql, agent, { version, enabled }) {
8181
var cb = arguments[0]
8282

8383
if (typeof cb === 'function') {
84-
arguments[0] = agent._instrumentation.bindFunction(function wrapedCallback (err, connection) { // eslint-disable-line handle-callback-err
84+
arguments[0] = agent._instrumentation.bindFunction(function wrapedCallback (err, connection) { // eslint-disable-line node/handle-callback-err
8585
if (connection) wrapQueryable(connection, 'getConnection() > connection', agent)
8686
return cb.apply(this, arguments)
8787
})

lib/instrumentation/span-compression.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ class SpanCompression {
115115

116116
const isAlreadyComposite = this.isComposite()
117117
const canBeCompressed = isAlreadyComposite
118-
? this.tryToCompressComposite(compositeSpan, spanToCompress) : this.tryToCompressRegular(compositeSpan, spanToCompress)
118+
? this.tryToCompressComposite(compositeSpan, spanToCompress)
119+
: this.tryToCompressRegular(compositeSpan, spanToCompress)
119120

120121
if (!canBeCompressed) {
121122
return false

lib/tracecontext/tracestate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ class TraceState {
247247
if (key.length > 256 || key.length < 1) {
248248
return false
249249
}
250-
250+
// eslint-disable-next-line prefer-regex-literals
251251
const re = new RegExp(
252252
'^[abcdefghijklmnopqrstuvwxyz0123456789_\\-\\*/]*$'
253253
)

test/instrumentation/modules/http/aborted-requests-enabled.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ test('client-side abort below error threshold - call end', { timeout: 10000 }, f
4242

4343
t.strictEqual(agent._apmClient._writes.length, 0, 'should not have any samples to begin with')
4444

45-
agent.captureError = function (err, opts) { // eslint-disable-line handle-callback-err
45+
agent.captureError = function (err, opts) { // eslint-disable-line node/handle-callback-err
4646
t.fail('should not register the closed socket as an error')
4747
}
4848
agent._instrumentation.addEndedTransaction = function () {
@@ -144,7 +144,7 @@ test('client-side abort below error threshold - don\'t call end', function (t) {
144144

145145
t.strictEqual(agent._apmClient._writes.length, 0, 'should not have any samples to begin with')
146146

147-
agent.captureError = function (err, opts) { // eslint-disable-line handle-callback-err
147+
agent.captureError = function (err, opts) { // eslint-disable-line node/handle-callback-err
148148
t.fail('should not register the closed socket as an error')
149149
}
150150
agent._instrumentation.addEndedTransaction = function () {
@@ -222,7 +222,7 @@ test('server-side abort below error threshold and socket closed - call end', fun
222222

223223
t.strictEqual(agent._apmClient._writes.length, 0, 'should not have any samples to begin with')
224224

225-
agent.captureError = function (err, opts) { // eslint-disable-line handle-callback-err
225+
agent.captureError = function (err, opts) { // eslint-disable-line node/handle-callback-err
226226
t.fail('should not register the closed socket as an error')
227227
}
228228
agent._instrumentation.addEndedTransaction = function () {
@@ -311,7 +311,7 @@ test('server-side abort below error threshold and socket closed - don\'t call en
311311

312312
t.strictEqual(agent._apmClient._writes.length, 0, 'should not have any samples to begin with')
313313

314-
agent.captureError = function (err, opts) { // eslint-disable-line handle-callback-err
314+
agent.captureError = function (err, opts) { // eslint-disable-line node/handle-callback-err
315315
t.fail('should not register the closed socket as an error')
316316
}
317317
agent._instrumentation.addEndedTransaction = function () {
@@ -391,7 +391,7 @@ test('server-side abort below error threshold but socket not closed - call end',
391391

392392
t.strictEqual(agent._apmClient._writes.length, 0, 'should not have any samples to begin with')
393393

394-
agent.captureError = function (err, opts) { // eslint-disable-line handle-callback-err
394+
agent.captureError = function (err, opts) { // eslint-disable-line node/handle-callback-err
395395
t.fail('should not register the closed socket as an error')
396396
}
397397
agent._instrumentation.addEndedTransaction = addEndedTransaction
@@ -429,7 +429,7 @@ test('server-side abort above error threshold but socket not closed - call end',
429429

430430
t.strictEqual(agent._apmClient._writes.length, 0, 'should not have any samples to begin with')
431431

432-
agent.captureError = function (err, opts) { // eslint-disable-line handle-callback-err
432+
agent.captureError = function (err, opts) { // eslint-disable-line node/handle-callback-err
433433
t.fail('should not register the closed socket as an error')
434434
}
435435
agent._instrumentation.addEndedTransaction = addEndedTransaction

test/instrumentation/modules/http2.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,9 @@ isSecure.forEach(secure => {
309309
semver.lt(process.version, '8.11.2-rc')
310310
? onPushStream
311311
: (err, pushStream, headers) => {
312-
t.error(err)
313-
onPushStream(pushStream, headers)
314-
}
312+
t.error(err)
313+
onPushStream(pushStream, headers)
314+
}
315315
))
316316

317317
stream.respond({

test/metrics/index.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,5 +244,7 @@ test('Metrics objects do not throw/crash when not started', function (t) {
244244

245245
function spinCPUFor (durationMs) {
246246
const start = Date.now()
247-
while (Date.now() - start < durationMs) {}
247+
while (Date.now() - start < durationMs) {
248+
// spin
249+
}
248250
}

0 commit comments

Comments
 (0)