Fix linter

This commit is contained in:
salesh 2021-01-15 20:01:26 +01:00
parent 44b698e324
commit dfe518b4b6
22 changed files with 24 additions and 140 deletions

View File

@ -1 +0,0 @@
{ "extends": "standard" }

View File

@ -43,56 +43,48 @@ const chill = winston.createLogger({
const run = bench([
function benchBunyan (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
blog.info('hello world')
}
setImmediate(cb)
},
function benchWinston (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
chill.log('info', 'hello world')
}
setImmediate(cb)
},
function benchBole (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
bole.info('hello world')
}
setImmediate(cb)
},
function benchDebug (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
dlog('hello world')
}
setImmediate(cb)
},
function benchLogLevel (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
loglevel.info('hello world')
}
setImmediate(cb)
},
function benchPino (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogDest.info('hello world')
}
setImmediate(cb)
},
function benchPinoAsync (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogAsync.info('hello world')
}
setImmediate(cb)
},
function benchPinoNodeStream (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogNodeStream.info('hello world')
}

View File

@ -24,28 +24,24 @@ const blog = bunyan.createLogger({
const run = bench([
function benchBunyanChildChild (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
blog.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoChildChild (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogDest.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoAsyncChildChild (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogAsync.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoNodeStreamChildChild (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogNodeStream.info({ hello: 'world' })
}

View File

@ -28,7 +28,6 @@ require('bole').output({
const run = bench([
function benchBunyanCreation (cb) {
const child = blog.child({ a: 'property' })
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
child.info({ hello: 'world' })
}
@ -36,7 +35,6 @@ const run = bench([
},
function benchBoleCreation (cb) {
const child = bole('child')
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
child.info({ hello: 'world' })
}
@ -44,7 +42,6 @@ const run = bench([
},
function benchPinoCreation (cb) {
const child = plogDest.child({ a: 'property' })
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
child.info({ hello: 'world' })
}
@ -52,7 +49,6 @@ const run = bench([
},
function benchPinoAsyncCreation (cb) {
const child = plogAsync.child({ a: 'property' })
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
child.info({ hello: 'world' })
}
@ -60,7 +56,6 @@ const run = bench([
},
function benchPinoNodeStreamCreation (cb) {
const child = plogNodeStream.child({ a: 'property' })
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
child.info({ hello: 'world' })
}

View File

@ -28,35 +28,30 @@ require('bole').output({
const run = bench([
function benchBunyanChild (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
blog.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchBoleChild (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
bole.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoChild (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogDest.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoAssyncChild (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogAsync.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoNodeStreamChild (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogNodeStream.info({ hello: 'world' })
}

View File

@ -42,49 +42,42 @@ const chill = winston.createLogger({
const run = bench([
function benchBunyanDeepObj (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
blog.info(deep)
}
setImmediate(cb)
},
function benchWinstonDeepObj (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
chill.log(deep)
}
setImmediate(cb)
},
function benchBoleDeepObj (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
bole.info(deep)
}
setImmediate(cb)
},
function benchLogLevelDeepObj (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
loglevel.info(deep)
}
setImmediate(cb)
},
function benchPinoDeepObj (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogDest.info(deep)
}
setImmediate(cb)
},
function benchPinoAsyncDeepObj (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogAsync.info(deep)
}
setImmediate(cb)
},
function benchPinoNodeStreamDeepObj (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogNodeStream.info(deep)
}

View File

@ -34,14 +34,12 @@ const max = 10
const run = bench([
function benchPinoNoFormatters (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
pinoNoFormatters.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoFormatters (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
pinoFormatters.info({ hello: 'world' })
}

View File

@ -17,35 +17,30 @@ const max = 100
const run = bench([
function benchPinoNoCustomLevel (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
base.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoCustomLevel (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
baseCl.foo({ hello: 'world' })
}
setImmediate(cb)
},
function benchChildNoCustomLevel (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
child.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoChildCustomLevel (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
childCl.foo({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoChildInheritedCustomLevel (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
childOfBaseCl.foo({ hello: 'world' })
}
@ -53,7 +48,6 @@ const run = bench([
},
function benchPinoChildCreation (cb) {
const child = base.child({})
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
child.info({ hello: 'world' })
}
@ -63,7 +57,6 @@ const run = bench([
const child = base.child({
customLevels: { foo: 31 }
})
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
child.foo({ hello: 'world' })
}

View File

@ -18,63 +18,54 @@ const max = 10
const run = bench([
function benchPinoLongString (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plog.info(longStr)
}
setImmediate(cb)
},
function benchPinoDestLongString (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogDest.info(longStr)
}
setImmediate(cb)
},
function benchPinoAsyncLongString (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogAsync.info(longStr)
}
setImmediate(cb)
},
function benchPinoDeepObj (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plog.info(deep)
}
setImmediate(cb)
},
function benchPinoDestDeepObj (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogDest.info(deep)
}
setImmediate(cb)
},
function benchPinoAsyncDeepObj (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogAsync.info(deep)
}
setImmediate(cb)
},
function benchPinoInterpolateDeep (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plog.info('hello %j', deep)
}
setImmediate(cb)
},
function benchPinoDestInterpolateDeep (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogDest.info('hello %j', deep)
}
setImmediate(cb)
},
function benchPinoAsyncInterpolateDeep (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogAsync.info('hello %j', deep)
}

View File

@ -20,84 +20,72 @@ const max = 10
const run = bench([
function benchPino (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plog.info('hello world')
}
setImmediate(cb)
},
function benchPinoDest (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogDest.info('hello world')
}
setImmediate(cb)
},
function benchPinoExtreme (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogAsync.info('hello world')
}
setImmediate(cb)
},
function benchPinoObj (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plog.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoDestObj (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogDest.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoAsyncObj (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogAsync.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoChild (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogChild.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoDestChild (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogDestChild.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoAsyncChild (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogAsyncChild.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoChildChild (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogChildChild.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoDestChildChild (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogDestChildChild.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoAsyncChildChild (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogAsyncChildChild.info({ hello: 'world' })
}
@ -105,7 +93,6 @@ const run = bench([
},
function benchPinoChildCreation (cb) {
const child = plog.child({ a: 'property' })
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
child.info({ hello: 'world' })
}
@ -113,91 +100,78 @@ const run = bench([
},
function benchPinoDestChildCreation (cb) {
const child = plogDest.child({ a: 'property' })
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
child.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoMulti (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plog.info('hello', 'world')
}
setImmediate(cb)
},
function benchPinoDestMulti (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogDest.info('hello', 'world')
}
setImmediate(cb)
},
function benchPinoAsyncMulti (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogAsync.info('hello', 'world')
}
setImmediate(cb)
},
function benchPinoInterpolate (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plog.info('hello %s', 'world')
}
setImmediate(cb)
},
function benchPinoDestInterpolate (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogDest.info('hello %s', 'world')
}
setImmediate(cb)
},
function benchPinoDestInterpolate (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogDest.info('hello %s', 'world')
}
setImmediate(cb)
},
function benchPinoInterpolateAll (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plog.info('hello %s %j %d', 'world', { obj: true }, 4)
}
setImmediate(cb)
},
function benchPinoDestInterpolateAll (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogDest.info('hello %s %j %d', 'world', { obj: true }, 4)
}
setImmediate(cb)
},
function benchPinoAsyncInterpolateAll (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogAsync.info('hello %s %j %d', 'world', { obj: true }, 4)
}
setImmediate(cb)
},
function benchPinoInterpolateExtra (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plog.info('hello %s %j %d', 'world', { obj: true }, 4, { another: 'obj' })
}
setImmediate(cb)
},
function benchPinoDestInterpolateExtra (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogDest.info('hello %s %j %d', 'world', { obj: true }, 4, { another: 'obj' })
}
setImmediate(cb)
},
function benchPinoAsyncInterpolateExtra (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogAsync.info('hello %s %j %d', 'world', { obj: true }, 4, { another: 'obj' })
}

View File

@ -17,63 +17,54 @@ const max = 100
const run = bench([
function benchPinoBase (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
base.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoChild (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
child.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoChildChild (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
childChild.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoChildChildChild (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
childChildChild.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoChildChildChildChild (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
childChildChildChild.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoChild2 (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
child2.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoBaseSerilalizers (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
baseSerializers.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoBaseSerilalizersChild (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
baseSerializersChild.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoBaseSerilalizersChildSeriazliers (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
baseSerializersChildSerializers.info({ hello: 'world' })
}

View File

@ -34,56 +34,48 @@ const max = 10
const run = bench([
function benchPinoNoRedact (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plog.info({ a: { b: { c: 'redact me.', d: 'leave me' } } })
}
setImmediate(cb)
},
function benchPinoRedact (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogRedact.info({ a: { b: { c: 'redact me.', d: 'leave me' } } })
}
setImmediate(cb)
},
function benchPinoUnsafeNoRedact (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogUnsafe.info({ a: { b: { c: 'redact me.', d: 'leave me' } } })
}
setImmediate(cb)
},
function benchPinoUnsafeRedact (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogUnsafeRedact.info({ a: { b: { c: 'redact me.', d: 'leave me' } } })
}
setImmediate(cb)
},
function benchPinoAsyncNoRedact (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogAsync.info({ a: { b: { c: 'redact me.', d: 'leave me' } } })
}
setImmediate(cb)
},
function benchPinoAsyncRedact (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogAsyncRedact.info({ a: { b: { c: 'redact me.', d: 'leave me' } } })
}
setImmediate(cb)
},
function benchPinoUnsafeAsyncNoRedact (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogUnsafeAsync.info({ a: { b: { c: 'redact me.', d: 'leave me' } } })
}
setImmediate(cb)
},
function benchPinoUnsafeAsyncRedact (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogUnsafeAsyncRedact.info({ a: { b: { c: 'redact me.', d: 'leave me' } } })
}

View File

@ -41,42 +41,36 @@ const chill = winston.createLogger({
const run = bench([
function benchBunyan (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
blog.info(longStr)
}
setImmediate(cb)
},
function benchWinston (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
chill.info(longStr)
}
setImmediate(cb)
},
function benchBole (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
bole.info(longStr)
}
setImmediate(cb)
},
function benchPino (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogDest.info(longStr)
}
setImmediate(cb)
},
function benchPinoAsync (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogAsync.info(longStr)
}
setImmediate(cb)
},
function benchPinoNodeStream (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogNodeStream.info(longStr)
}

View File

@ -44,49 +44,42 @@ const max = 10
const run = bench([
function benchBunyanInterpolate (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
blog.info('hello %s', 'world')
}
setImmediate(cb)
},
function benchWinstonInterpolate (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
chill.log('info', 'hello %s', 'world')
}
setImmediate(cb)
},
function benchBoleInterpolate (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
bole.info('hello %s', 'world')
}
setImmediate(cb)
},
function benchPinoInterpolate (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogDest.info('hello %s', 'world')
}
setImmediate(cb)
},
function benchPinoAsyncInterpolate (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogAsync.info('hello %s', 'world')
}
setImmediate(cb)
},
function benchPinoNodeStreamInterpolate (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogNodeStream.info('hello %s', 'world')
}
setImmediate(cb)
},
function benchBunyanInterpolateAll (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
blog.info('hello %s %j %d', 'world', { obj: true }, 4)
}
@ -94,119 +87,102 @@ const run = bench([
},
function benchWinstonInterpolateAll (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
chill.log('info', 'hello %s %j %d', 'world', { obj: true }, 4)
}
setImmediate(cb)
},
function benchBoleInterpolateAll (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
bole.info('hello %s %j %d', 'world', { obj: true }, 4)
}
setImmediate(cb)
},
function benchPinoInterpolateAll (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogDest.info('hello %s %j %d', 'world', { obj: true }, 4)
}
setImmediate(cb)
},
function benchPinoAsyncInterpolateAll (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogAsync.info('hello %s %j %d', 'world', { obj: true }, 4)
}
setImmediate(cb)
},
function benchPinoNodeStreamInterpolateAll (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogNodeStream.info('hello %s %j %d', 'world', { obj: true }, 4)
}
setImmediate(cb)
},
function benchBunyanInterpolateExtra (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
blog.info('hello %s %j %d', 'world', { obj: true }, 4, { another: 'obj' })
}
setImmediate(cb)
},
function benchWinstonInterpolateExtra (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
chill.log('info', 'hello %s %j %d', 'world', { obj: true }, 4, { another: 'obj' })
}
setImmediate(cb)
},
function benchBoleInterpolateExtra (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
bole.info('hello %s %j %d', 'world', { obj: true }, 4, { another: 'obj' })
}
setImmediate(cb)
},
function benchPinoInterpolateExtra (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogDest.info('hello %s %j %d', 'world', { obj: true }, 4, { another: 'obj' })
}
setImmediate(cb)
},
function benchPinoAsyncInterpolateExtra (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogAsync.info('hello %s %j %d', 'world', { obj: true }, 4, { another: 'obj' })
}
setImmediate(cb)
},
function benchPinoNodeStreamInterpolateExtra (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogNodeStream.info('hello %s %j %d', 'world', { obj: true }, 4, { another: 'obj' })
}
setImmediate(cb)
},
function benchBunyanInterpolateDeep (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
blog.info('hello %j', deep)
}
setImmediate(cb)
},
function benchWinstonInterpolateDeep (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
chill.log('info', 'hello %j', deep)
}
setImmediate(cb)
},
function benchBoleInterpolateDeep (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
bole.info('hello %j', deep)
}
setImmediate(cb)
},
function benchPinoInterpolateDeep (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogDest.info('hello %j', deep)
}
setImmediate(cb)
},
function benchPinoAsyncInterpolateDeep (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogAsync.info('hello %j', deep)
}
setImmediate(cb)
},
function benchPinoNodeStreamInterpolateDeep (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogNodeStream.info('hello %j', deep)
}

View File

@ -36,49 +36,42 @@ const max = 10
const run = bench([
function benchBunyanObj (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
blog.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchWinstonObj (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
chill.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchBoleObj (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
bole.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchLogLevelObject (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
loglevel.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoObj (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogDest.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoAsyncObj (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogAsync.info({ hello: 'world' })
}
setImmediate(cb)
},
function benchPinoNodeStreamObj (cb) {
/* eslint no-var: off */
for (var i = 0; i < max; i++) {
plogNodeStream.info({ hello: 'world' })
}

View File

@ -91,7 +91,6 @@ function runBenchmark (name, done) {
function sum (arr) {
let result = 0
/* eslint no-var: off */
for (var i = 0; i < arr.length; i += 1) {
result += Number.parseFloat(arr[i].time)
}
@ -101,7 +100,6 @@ function sum (arr) {
function displayResults (results) {
if (quiet === false) console.log('==========')
const benchNames = Object.keys(results)
/* eslint no-var: off */
for (var i = 0; i < benchNames.length; i += 1) {
console.log(`${benchNames[i].toUpperCase()} benchmark averages`)
const benchmark = results[benchNames[i]]
@ -130,7 +128,6 @@ if (selectedBenchmark !== 'all') {
benchQueue.push(toBench.bind({ name: selectedBenchmark }))
} else {
const keys = Object.keys(benchmarks)
/* eslint no-var: off */
for (var i = 0; i < keys.length; i += 1) {
benchQueue.push(toBench.bind({ name: keys[i] }))
}

View File

@ -33,7 +33,6 @@ function build (dest) {
} else {
array = new Array(arguments.length + 1)
array[0] = '[' + time.toISOString() + ']'
/* eslint no-var: off */
for (var i = 0; i < arguments.length; i++) {
array[i + 1] = arguments[i]
}

View File

@ -180,7 +180,6 @@ function wrap (opts, logger, level) {
const ts = opts.timestamp()
const args = new Array(arguments.length)
const proto = (Object.getPrototypeOf && Object.getPrototypeOf(this) === _console) ? _console : this
/* eslint no-var: off */
for (var i = 0; i < args.length; i++) args[i] = arguments[i]
if (opts.serialize && !opts.asObject) {
@ -248,7 +247,6 @@ function bind (parent, bindings, level) {
return function () {
const args = new Array(1 + arguments.length)
args[0] = bindings
/* eslint no-var: off */
for (var i = 1; i < args.length; i++) {
args[i] = arguments[i - 1]
}

17
eslintrc.json Normal file
View File

@ -0,0 +1,17 @@
{
"env": {
"browser": true,
"commonjs": true,
"es2021": true,
"node": true
},
"extends": [
"standard"
],
"parserOptions": {
"ecmaVersion": 12
},
"rules": {
"no-var": "off"
}
}

View File

@ -73,7 +73,6 @@ function asString (str) {
if (l > 100) {
return JSON.stringify(str)
}
/* eslint no-var: off */
for (var i = 0; i < l && point >= 32; i++) {
point = str.charCodeAt(i)
if (point === 34 || point === 92) {
@ -261,7 +260,6 @@ function prettifierMetaWrapper (pretty, dest, opts) {
const serializers = lastLogger[serializersSym]
const keys = Object.keys(serializers)
/* eslint no-var: off */
for (var i = 0; i < keys.length; i++) {
const key = keys[i]
if (obj[key] !== undefined) {

View File

@ -18,7 +18,8 @@
"scripts": {
"docs": "docsify serve",
"browser-test": "airtap --local 8080 test/browser*test.js",
"test": "standard | snazzy && tap --100 test/*test.js test/*/*test.js",
"lint": "eslint . --config=eslintrc.json",
"test": "npm run lint && tap --100 test/*test.js test/*/*test.js",
"cov-ui": "tap --coverage-report=html test/*test.js test/*/*test.js",
"bench": "node benchmarks/utils/runbench all",
"bench-basic": "node benchmarks/utils/runbench basic",
@ -63,6 +64,11 @@
"bole": "^4.0.0",
"bunyan": "^1.8.14",
"docsify-cli": "^4.4.1",
"eslint": "^7.17.0",
"eslint-config-standard": "^16.0.2",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"execa": "^4.0.0",
"fastbench": "^1.0.1",
"flush-write-stream": "^2.0.0",
@ -74,9 +80,7 @@
"proxyquire": "^2.1.3",
"pump": "^3.0.0",
"semver": "^7.0.0",
"snazzy": "^8.0.0",
"split2": "^3.1.1",
"standard": "^16.0.3",
"steed": "^1.1.3",
"strip-ansi": "^6.0.0",
"tap": "^14.10.8",

View File

@ -7,7 +7,6 @@ require('os').hostname = function () { return 'abcdefghijklmnopqr' }
const pino = require('../../..')
const logger = pino(pino.destination({ sync: false }))
/* eslint no-var: off */
for (var i = 0; i < 1000; i++) {
logger.info('hello world')
}