Skip to content

Commit

Permalink
chore: ignore voids
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed Jan 11, 2025
1 parent 97bae3b commit ec343f1
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions templates/app-ts-esm/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const app: FastifyPluginAsync<AppOptions> = 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,
Expand All @@ -33,6 +34,7 @@ const app: FastifyPluginAsync<AppOptions> = 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,
Expand Down
1 change: 1 addition & 0 deletions templates/app-ts-esm/test/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ async function build (t: TestContext) {
const app = await helper.build(argv, await config())

// Tear down our app after we are done
// eslint-disable-next-line no-void
t.after(() => void app.close())

return app
Expand Down
1 change: 1 addition & 0 deletions templates/app-ts-esm/test/plugins/support.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 2 additions & 0 deletions templates/app-ts/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ const app: FastifyPluginAsync<AppOptions> = 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
})

// 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
Expand Down
1 change: 1 addition & 0 deletions templates/app-ts/test/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ async function build (t: TestContext) {
const app = await helper.build(argv, await config())

// Tear down our app after we are done
// eslint-disable-next-line no-void
t.after(() => void app.close())

return app
Expand Down
1 change: 1 addition & 0 deletions templates/app-ts/test/plugins/support.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
2 changes: 2 additions & 0 deletions templates/plugin/test/index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit ec343f1

Please sign in to comment.