From 0d900d763a4d8ce17b557e0ddd85876f3497935a Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Sat, 11 Jan 2025 16:58:04 +0000 Subject: [PATCH] chore: ignore voids --- templates/app-ts-esm/src/app.ts | 2 ++ templates/app-ts-esm/test/helper.ts | 1 + templates/app-ts-esm/test/plugins/support.test.ts | 1 + templates/app-ts/src/app.ts | 2 ++ templates/app-ts/test/helper.ts | 1 + templates/app-ts/test/plugins/support.test.ts | 1 + templates/plugin/test/index.test-d.ts | 2 ++ 7 files changed, 10 insertions(+) diff --git a/templates/app-ts-esm/src/app.ts b/templates/app-ts-esm/src/app.ts index 0134e606..74d9ff01 100644 --- a/templates/app-ts-esm/src/app.ts +++ b/templates/app-ts-esm/src/app.ts @@ -25,6 +25,7 @@ const app: FastifyPluginAsync = async ( // This loads all plugins defined in plugins // those should be support plugins that are reused // through your application + // eslint-disable-next-line no-void void fastify.register(AutoLoad, { dir: path.join(__dirname, 'plugins'), options: opts, @@ -33,6 +34,7 @@ const app: FastifyPluginAsync = async ( // This loads all plugins defined in routes // define your routes in one of these + // eslint-disable-next-line no-void void fastify.register(AutoLoad, { dir: path.join(__dirname, 'routes'), options: opts, diff --git a/templates/app-ts-esm/test/helper.ts b/templates/app-ts-esm/test/helper.ts index f66f9802..c42414a2 100644 --- a/templates/app-ts-esm/test/helper.ts +++ b/templates/app-ts-esm/test/helper.ts @@ -31,6 +31,7 @@ async function build (t: TestContext) { const app = await helper.build(argv, config()) // Tear down our app after we are done + // eslint-disable-next-line no-void t.after(() => void app.close()) return app diff --git a/templates/app-ts-esm/test/plugins/support.test.ts b/templates/app-ts-esm/test/plugins/support.test.ts index c10957ba..b260072b 100644 --- a/templates/app-ts-esm/test/plugins/support.test.ts +++ b/templates/app-ts-esm/test/plugins/support.test.ts @@ -5,6 +5,7 @@ import Support from '../../src/plugins/support.js' test('support works standalone', async (t) => { const fastify = Fastify() + // eslint-disable-next-line no-void void fastify.register(Support) await fastify.ready() diff --git a/templates/app-ts/src/app.ts b/templates/app-ts/src/app.ts index f9042a85..b890c4ee 100644 --- a/templates/app-ts/src/app.ts +++ b/templates/app-ts/src/app.ts @@ -20,6 +20,7 @@ const app: FastifyPluginAsync = async ( // This loads all plugins defined in plugins // those should be support plugins that are reused // through your application + // eslint-disable-next-line no-void void fastify.register(AutoLoad, { dir: join(__dirname, 'plugins'), options: opts @@ -27,6 +28,7 @@ const app: FastifyPluginAsync = async ( // This loads all plugins defined in routes // define your routes in one of these + // eslint-disable-next-line no-void void fastify.register(AutoLoad, { dir: join(__dirname, 'routes'), options: opts diff --git a/templates/app-ts/test/helper.ts b/templates/app-ts/test/helper.ts index 53a0e158..f30cc8f4 100644 --- a/templates/app-ts/test/helper.ts +++ b/templates/app-ts/test/helper.ts @@ -28,6 +28,7 @@ async function build (t: TestContext) { const app = await helper.build(argv, config()) // Tear down our app after we are done + // eslint-disable-next-line no-void t.after(() => void app.close()) return app diff --git a/templates/app-ts/test/plugins/support.test.ts b/templates/app-ts/test/plugins/support.test.ts index d3b5c468..7ac0544f 100644 --- a/templates/app-ts/test/plugins/support.test.ts +++ b/templates/app-ts/test/plugins/support.test.ts @@ -6,6 +6,7 @@ import Support from '../../src/plugins/support' test('support works standalone', async (t) => { const fastify = Fastify() + // eslint-disable-next-line no-void void fastify.register(Support) await fastify.ready() diff --git a/templates/plugin/test/index.test-d.ts b/templates/plugin/test/index.test-d.ts index 72f3d6be..8c30185a 100644 --- a/templates/plugin/test/index.test-d.ts +++ b/templates/plugin/test/index.test-d.ts @@ -5,7 +5,9 @@ import { expectType } from 'tsd' let app try { app = fastify() + // eslint-disable-next-line no-void void app.ready() + // eslint-disable-next-line no-void void app.register(example) expectType<() => string>(app.exampleDecorator) } catch (err) {