Skip to content

Commit

Permalink
refactor: prefix unused params with underscores (#162)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs authored Jan 5, 2025
1 parent 21bb215 commit d2bc2d4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
const isPromise = require('node:util').types.isPromise
const fp = require('fastify-plugin')

function fastifyFunky (fastify, opts, next) {
fastify.addHook('preSerialization', (req, res, payload, done) => {
function fastifyFunky (fastify, _opts, next) {
fastify.addHook('preSerialization', (_req, res, payload, done) => {
// Handle Either
if (isEither(payload)) {
return resolvePayload(done, payload.left, payload.right, res)
Expand Down
2 changes: 1 addition & 1 deletion test/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function initAppGet (t, endpoint) {

app.get('/', endpoint)

app.setErrorHandler((error, request, reply) => {
app.setErrorHandler((error, _request, reply) => {
app.log.error(error)
t.assert.deepStrictEqual(error.message, 'Invalid state')
reply.status(500).send({ ok: false })
Expand Down
2 changes: 1 addition & 1 deletion types/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ expectType<any>(fastifyFunkyCjs)

app.register(fastifyFunkyDefault)
// this gives a type error:
app.get('/', (req: FastifyRequest, reply: FastifyReply) => {
app.get('/', (_req: FastifyRequest, _reply: FastifyReply) => {
return { right: { id: 1 } }
})

Expand Down

0 comments on commit d2bc2d4

Please sign in to comment.