Skip to content

Commit e5bb974

Browse files
committed
refactor: prefix unused params with underscores
1 parent d1bb544 commit e5bb974

21 files changed

+21
-21
lines changed

benchmarks/0http.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const cero = require('0http')
44
const { router, server } = cero()
55

6-
router.get('/', (req, res) => {
6+
router.get('/', (_req, res) => {
77
res.setHeader('content-type', 'application/json; charset=utf-8')
88
res.end(JSON.stringify({ hello: 'world' }))
99
})

benchmarks/bare.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
const server = require('node:http').createServer(function (req, res) {
3+
const server = require('node:http').createServer(function (_req, res) {
44
res.setHeader('content-type', 'application/json; charset=utf-8')
55
res.end(JSON.stringify({ hello: 'world' }))
66
})

benchmarks/connect-router.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const connect = require('connect')
44
const router = require('router')()
55

66
const app = connect()
7-
router.get('/', function (req, res) {
7+
router.get('/', function (_req, res) {
88
res.setHeader('content-type', 'application/json; charset=utf-8')
99
res.end(JSON.stringify({ hello: 'world' }))
1010
})

benchmarks/connect.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
const connect = require('connect')
44

55
const app = connect()
6-
app.use(function (req, res) {
6+
app.use(function (_req, res) {
77
res.setHeader('content-type', 'application/json; charset=utf-8')
88
res.end(JSON.stringify({ hello: 'world' }))
99
})

benchmarks/express-with-middlewares.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ app.use(require('hsts')())
1515
app.use(require('ienoopen')())
1616
app.use(require('x-xss-protection')())
1717

18-
app.get('/', function (req, res) {
18+
app.get('/', function (_req, res) {
1919
res.json({ hello: 'world' })
2020
})
2121

benchmarks/express.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const app = express()
77
app.disable('etag')
88
app.disable('x-powered-by')
99

10-
app.get('/', function (req, res) {
10+
app.get('/', function (_req, res) {
1111
res.json({ hello: 'world' })
1212
})
1313

benchmarks/fastify-big-json.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function Employee ({ id = null, title = null, employer = null } = {}) {
2626
this.employer = employer
2727
}
2828

29-
fastify.get('/', opts, function (request, reply) {
29+
fastify.get('/', opts, function (_request, reply) {
3030
const jobs = []
3131

3232
for (let i = 0; i < 200; i += 1) {

benchmarks/fastify.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const schema = {
1717
}
1818
}
1919

20-
fastify.get('/', schema, function (req, reply) {
20+
fastify.get('/', schema, function (_req, reply) {
2121
reply.send({ hello: 'world' })
2222
})
2323

benchmarks/hapi.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ async function start () {
1515
},
1616
state: { parse: false }
1717
},
18-
handler: function (request, h) {
18+
handler: function () {
1919
return { hello: 'world' }
2020
}
2121
})

benchmarks/micro-route.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const http = require('http')
44
const { send, serve } = require('micro')
55
const dispatch = require('micro-route/dispatch')
66

7-
const handler = (req, res) => send(res, 200, { hello: 'world' })
7+
const handler = (_req, res) => send(res, 200, { hello: 'world' })
88

99
const server = new http.Server(serve(dispatch('/', 'GET', handler)))
1010

0 commit comments

Comments
 (0)