Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: prefix unused params with underscores #162

Merged
merged 1 commit into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
@@ -1,10 +1,10 @@
import { FastifyInstance, FastifyPluginCallback, FastifyReply, FastifyRequest } from 'fastify'

Check failure on line 1 in types/index.test-d.ts

View workflow job for this annotation

GitHub Actions / test / Lint Code

'/home/runner/work/fastify-funky/fastify-funky/node_modules/fastify/fastify.d.ts' imported multiple times
import fastify from 'fastify'

Check failure on line 2 in types/index.test-d.ts

View workflow job for this annotation

GitHub Actions / test / Lint Code

'/home/runner/work/fastify-funky/fastify-funky/node_modules/fastify/fastify.d.ts' imported multiple times
import { either, task, taskEither } from 'fp-ts'
import { expectType, expectAssignable } from 'tsd'

import { fastifyFunky as fastifyFunkyNamed } from '..'

Check failure on line 6 in types/index.test-d.ts

View workflow job for this annotation

GitHub Actions / test / Lint Code

'/home/runner/work/fastify-funky/fastify-funky/index.js' imported multiple times
import fastifyFunkyDefault from '..'

Check failure on line 7 in types/index.test-d.ts

View workflow job for this annotation

GitHub Actions / test / Lint Code

'/home/runner/work/fastify-funky/fastify-funky/index.js' imported multiple times
import * as fastifyFunkyStar from '..'
import fastifyFunkyCjsImport = require('..')
const fastifyFunkyCjs = require('./')
Expand All @@ -28,7 +28,7 @@

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
Loading