From 7fa76402d42c02f2c1e375ec84a11828d619bebf Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Sun, 8 Dec 2024 10:44:20 +0000 Subject: [PATCH 1/5] build(deps-dev): replace standard with neostandard --- README.md | 8 +++--- helper.d.ts | 8 +++--- package.json | 12 +++------ templates/app-ts-esm/src/app.ts | 12 ++++----- .../app-ts-esm/src/routes/example/index.ts | 4 +-- templates/app-ts-esm/src/routes/root.ts | 2 +- templates/app-ts-esm/test/helper.ts | 2 +- templates/app-ts/src/app.ts | 8 +++--- templates/app-ts/src/routes/example/index.ts | 4 +-- templates/app-ts/src/routes/root.ts | 2 +- templates/app-ts/test/helper.ts | 2 +- templates/eject-ts/server.ts | 18 ++++++------- test/data/custom-import.mjs | 2 +- test/data/custom-import2.mjs | 2 +- test/templates/app-ts.test.ts | 26 +++++++++---------- 15 files changed, 52 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index b463f31b..ad677172 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![CI](https://github.com/fastify/fastify-cli/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/fastify/fastify-cli/actions/workflows/ci.yml) [![NPM version](https://img.shields.io/npm/v/fastify-cli.svg?style=flat)](https://www.npmjs.com/package/fastify-cli) -[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://standardjs.com/) +[![neostandard javascript style](https://img.shields.io/badge/code_style-neostandard-brightgreen?style=flat)](https://github.com/neostandard/neostandard) Command line tools for [Fastify](https://github.com/fastify/fastify). Generate, write, and run an application with one single command! @@ -326,15 +326,15 @@ if your project uses `@fastify/swagger`, `fastify-cli` can generate and write ou ```diff "devDependencies": { -+ "standard": "^11.0.1", ++ "neostandard": "^0.11.9", } "scripts": { -+ "pretest": "standard", ++ "pretest": "eslint", "test": "node --test test/**/*.test.js", "start": "fastify start -l info app.js", "dev": "fastify start -l info -P app.js", -+ "lint": "standard --fix" ++ "lint": "eslint --fix" }, ``` diff --git a/helper.d.ts b/helper.d.ts index f8642543..55debb87 100644 --- a/helper.d.ts +++ b/helper.d.ts @@ -1,9 +1,9 @@ import fastify from 'fastify' declare module 'fastify-cli/helper.js' { - module helper { - export function build(args: Array, additionalOptions?: Object, serverOptions?: Object): ReturnType; - } + module helper { + export function build (args: Array, additionalOptions?: Object, serverOptions?: Object): ReturnType + } - export = helper; + export = helper } diff --git a/package.json b/package.json index 7f42bb87..e78761ba 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "fastify": "cli.js" }, "scripts": { - "lint": "standard", - "lint:fix": "standard --fix", + "lint": "eslint", + "lint:fix": "eslint --fix", "pretest": "xcopy /e /k /i . \"..\\node_modules\\fastify-cli\" || rsync -r --exclude=node_modules ./ node_modules/fastify-cli || echo 'this is fine'", "test": "npm run unit:suites && c8 --clean npm run test:cli-and-typescript", "unit:cjs": "node suite-runner.js \"templates/app/test/**/*.test.js\"", @@ -46,12 +46,6 @@ "url": "https://github.com/fastify/fastify-cli/issues" }, "homepage": "https://github.com/fastify/fastify-cli#readme", - "standard": { - "ignore": [ - "test/data/parsing-error.js", - "test/data/undefinedVariable.js" - ] - }, "dependencies": { "@fastify/deepmerge": "^2.0.0", "chalk": "^4.1.2", @@ -82,11 +76,11 @@ "fastify-tsconfig": "^3.0.0", "glob": "^11.0.1", "minimatch": "^9.0.5", + "neostandard": "^0.11.9", "proxyquire": "^2.1.3", "rimraf": "^3.0.2", "simple-get": "^4.0.0", "sinon": "^19.0.2", - "standard": "^17.0.0", "strip-ansi": "^6.0.1", "tap": "^16.1.0", "ts-node": "^10.4.0", diff --git a/templates/app-ts-esm/src/app.ts b/templates/app-ts-esm/src/app.ts index a39a8071..37bee208 100644 --- a/templates/app-ts-esm/src/app.ts +++ b/templates/app-ts-esm/src/app.ts @@ -8,16 +8,15 @@ const __dirname = path.dirname(__filename) export type AppOptions = { // Place your custom options for app below here. -} & Partial; - +} & Partial // Pass --options via CLI arguments in command to enable these options. const options: AppOptions = { } const app: FastifyPluginAsync = async ( - fastify, - opts + fastify, + opts ): Promise => { // Place here your custom code! @@ -39,8 +38,7 @@ const app: FastifyPluginAsync = async ( options: opts, forceESM: true }) +} -}; - -export default app; +export default app export { app, options } diff --git a/templates/app-ts-esm/src/routes/example/index.ts b/templates/app-ts-esm/src/routes/example/index.ts index 819c5e77..68a0ea13 100644 --- a/templates/app-ts-esm/src/routes/example/index.ts +++ b/templates/app-ts-esm/src/routes/example/index.ts @@ -1,4 +1,4 @@ -import { FastifyPluginAsync } from "fastify" +import { FastifyPluginAsync } from 'fastify' const example: FastifyPluginAsync = async (fastify, opts): Promise => { fastify.get('/', async function (request, reply) { @@ -6,4 +6,4 @@ const example: FastifyPluginAsync = async (fastify, opts): Promise => { }) } -export default example; +export default example diff --git a/templates/app-ts-esm/src/routes/root.ts b/templates/app-ts-esm/src/routes/root.ts index 2a1b3342..27918c71 100644 --- a/templates/app-ts-esm/src/routes/root.ts +++ b/templates/app-ts-esm/src/routes/root.ts @@ -6,4 +6,4 @@ const root: FastifyPluginAsync = async (fastify, opts): Promise => { }) } -export default root; +export default root diff --git a/templates/app-ts-esm/test/helper.ts b/templates/app-ts-esm/test/helper.ts index d389d14c..f66f9802 100644 --- a/templates/app-ts-esm/test/helper.ts +++ b/templates/app-ts-esm/test/helper.ts @@ -6,7 +6,7 @@ import { fileURLToPath } from 'node:url' export type TestContext = { after: typeof test.after -}; +} const __filename = fileURLToPath(import.meta.url) const __dirname = path.dirname(__filename) diff --git a/templates/app-ts/src/app.ts b/templates/app-ts/src/app.ts index e68fa353..52ba5d88 100644 --- a/templates/app-ts/src/app.ts +++ b/templates/app-ts/src/app.ts @@ -10,8 +10,8 @@ const options: AppOptions = { } const app: FastifyPluginAsync = async ( - fastify, - opts + fastify, + opts ): Promise => { // Place here your custom code! @@ -31,7 +31,7 @@ const app: FastifyPluginAsync = async ( dir: join(__dirname, 'routes'), options: opts }) -}; +} -export default app; +export default app export { app, options } diff --git a/templates/app-ts/src/routes/example/index.ts b/templates/app-ts/src/routes/example/index.ts index 819c5e77..68a0ea13 100644 --- a/templates/app-ts/src/routes/example/index.ts +++ b/templates/app-ts/src/routes/example/index.ts @@ -1,4 +1,4 @@ -import { FastifyPluginAsync } from "fastify" +import { FastifyPluginAsync } from 'fastify' const example: FastifyPluginAsync = async (fastify, opts): Promise => { fastify.get('/', async function (request, reply) { @@ -6,4 +6,4 @@ const example: FastifyPluginAsync = async (fastify, opts): Promise => { }) } -export default example; +export default example diff --git a/templates/app-ts/src/routes/root.ts b/templates/app-ts/src/routes/root.ts index 2a1b3342..27918c71 100644 --- a/templates/app-ts/src/routes/root.ts +++ b/templates/app-ts/src/routes/root.ts @@ -6,4 +6,4 @@ const root: FastifyPluginAsync = async (fastify, opts): Promise => { }) } -export default root; +export default root diff --git a/templates/app-ts/test/helper.ts b/templates/app-ts/test/helper.ts index 88178338..3612d1c3 100644 --- a/templates/app-ts/test/helper.ts +++ b/templates/app-ts/test/helper.ts @@ -5,7 +5,7 @@ import * as test from 'node:test' export type TestContext = { after: typeof test.after -}; +} const AppPath = path.join(__dirname, '..', 'src', 'app.ts') diff --git a/templates/eject-ts/server.ts b/templates/eject-ts/server.ts index 75ed54b1..55d23ff7 100644 --- a/templates/eject-ts/server.ts +++ b/templates/eject-ts/server.ts @@ -1,20 +1,20 @@ // Read the .env file. -import * as dotenv from "dotenv"; -dotenv.config(); +import * as dotenv from 'dotenv' +dotenv.config() // Require the framework -import Fastify from "fastify"; +import Fastify from 'fastify' // Require library to exit fastify process, gracefully (if possible) -import closeWithGrace from "close-with-grace"; +import closeWithGrace from 'close-with-grace' // Instantiate Fastify with some config const app = Fastify({ logger: true, -}); +}) // Register your application as a normal plugin. -app.register(import("./app")); +app.register(import('./app')) // delay is the number of milliseconds for the graceful close to finish closeWithGrace({ delay: parseInt(process.env.FASTIFY_CLOSE_GRACE_DELAY) || 500 }, async function ({ signal, err, manual }) { @@ -27,7 +27,7 @@ closeWithGrace({ delay: parseInt(process.env.FASTIFY_CLOSE_GRACE_DELAY) || 500 } // Start listening. app.listen({ port: parseInt(process.env.PORT) || 3000 }, (err: any) => { if (err) { - app.log.error(err); - process.exit(1); + app.log.error(err) + process.exit(1) } -}); +}) diff --git a/test/data/custom-import.mjs b/test/data/custom-import.mjs index 9dd35c4c..b72537f6 100644 --- a/test/data/custom-import.mjs +++ b/test/data/custom-import.mjs @@ -1,3 +1,3 @@ /* global GLOBAL_MODULE_3 */ -globalThis.GLOBAL_MODULE_3 = true // eslint-disable-line +globalThis.GLOBAL_MODULE_3 = true console.log('this is module to be preloaded that sets GLOBAL_MODULE_3=', GLOBAL_MODULE_3) diff --git a/test/data/custom-import2.mjs b/test/data/custom-import2.mjs index e3e2a2dd..9a7c4091 100644 --- a/test/data/custom-import2.mjs +++ b/test/data/custom-import2.mjs @@ -1,3 +1,3 @@ /* global GLOBAL_MODULE_4 */ -globalThis.GLOBAL_MODULE_4 = true // eslint-disable-line +globalThis.GLOBAL_MODULE_4 = true console.log('this is module to be preloaded that sets GLOBAL_MODULE_4=', GLOBAL_MODULE_4) diff --git a/test/templates/app-ts.test.ts b/test/templates/app-ts.test.ts index 3f0eeb27..770b13bb 100644 --- a/test/templates/app-ts.test.ts +++ b/test/templates/app-ts.test.ts @@ -6,21 +6,21 @@ import { AddressInfo } from "net"; import appDefault, { app } from '../../templates/app-ts/src/app'; const sget = (opts: Record): Record => { - return new Promise((resolve, reject) => { - sgetOriginal(opts, (err: Error, response: any, body: any) => { - if (err) return reject(err) - return resolve({ response, body }) - }) + return new Promise((resolve, reject) => { + sgetOriginal(opts, (err: Error, response: any, body: any) => { + if (err) return reject(err) + return resolve({ response, body }) }) + }) } test('should print routes for TS app', async (t: TestContext) => { t.plan(4) - const fastifyApp = fastify({}, ); - await app(fastifyApp, {}); - await fastifyApp.ready(); - await fastifyApp.listen({ port: 3000 }) + const fastifyApp = fastify({}) + await app(fastifyApp, {}) + await fastifyApp.ready() + await fastifyApp.listen({ port: 3000 }) const { response, body } = await sget({ method: 'GET', @@ -37,10 +37,10 @@ test('should print routes for TS app', async (t: TestContext) => { test('should print routes for default TS app', async (t: TestContext) => { t.plan(4) - const fastifyApp = fastify({}, ); - await appDefault(fastifyApp, {}); - await fastifyApp.ready(); - await fastifyApp.listen({ port: 3000 }) + const fastifyApp = fastify({}) + await appDefault(fastifyApp, {}) + await fastifyApp.ready() + await fastifyApp.listen({ port: 3000 }) const { response, body } = await sget({ method: 'GET', From a283c7c55d73da038aa7f6421f3530acb8a612e7 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Sun, 8 Dec 2024 10:53:17 +0000 Subject: [PATCH 2/5] chore: add eslint.config.js --- eslint.config.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 eslint.config.js diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 00000000..52c4f815 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,10 @@ +'use strict' + +module.exports = require('neostandard')({ + ignores: [ + ...require('neostandard').resolveIgnoresFromGitignore(), + 'test/data/parsing-error.js', + 'test/data/undefinedVariable.js', + ], + ts: true +}) From 2de39f5eabc991fb27ebb4c28e3dc163310a73f4 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Mon, 16 Dec 2024 12:40:05 +0000 Subject: [PATCH 3/5] chore: rebase --- package.json | 2 +- templates/app-ts-esm/src/app.ts | 6 ++-- templates/app-ts/src/app.ts | 6 ++-- templates/app-ts/test/helper.ts | 2 +- templates/eject-ts/server.ts | 2 +- test/templates/app-ts.test.ts | 52 ++++++++++++++++----------------- 6 files changed, 35 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index e78761ba..77336435 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "fastify-tsconfig": "^3.0.0", "glob": "^11.0.1", "minimatch": "^9.0.5", - "neostandard": "^0.11.9", + "neostandard": "^0.12.0", "proxyquire": "^2.1.3", "rimraf": "^3.0.2", "simple-get": "^4.0.0", diff --git a/templates/app-ts-esm/src/app.ts b/templates/app-ts-esm/src/app.ts index 37bee208..0134e606 100644 --- a/templates/app-ts-esm/src/app.ts +++ b/templates/app-ts-esm/src/app.ts @@ -1,6 +1,6 @@ -import * as path from 'node:path'; -import AutoLoad, {AutoloadPluginOptions} from '@fastify/autoload'; -import { FastifyPluginAsync } from 'fastify'; +import * as path from 'node:path' +import AutoLoad, { AutoloadPluginOptions } from '@fastify/autoload' +import { FastifyPluginAsync } from 'fastify' import { fileURLToPath } from 'node:url' const __filename = fileURLToPath(import.meta.url) diff --git a/templates/app-ts/src/app.ts b/templates/app-ts/src/app.ts index 52ba5d88..f9042a85 100644 --- a/templates/app-ts/src/app.ts +++ b/templates/app-ts/src/app.ts @@ -1,6 +1,6 @@ -import { join } from 'node:path'; -import AutoLoad, {AutoloadPluginOptions} from '@fastify/autoload'; -import { FastifyPluginAsync, FastifyServerOptions } from 'fastify'; +import { join } from 'node:path' +import AutoLoad, { AutoloadPluginOptions } from '@fastify/autoload' +import { FastifyPluginAsync, FastifyServerOptions } from 'fastify' export interface AppOptions extends FastifyServerOptions, Partial { diff --git a/templates/app-ts/test/helper.ts b/templates/app-ts/test/helper.ts index 3612d1c3..53a0e158 100644 --- a/templates/app-ts/test/helper.ts +++ b/templates/app-ts/test/helper.ts @@ -1,7 +1,7 @@ // This file contains code that we reuse between our tests. -const helper = require('fastify-cli/helper.js') import * as path from 'node:path' import * as test from 'node:test' +const helper = require('fastify-cli/helper.js') export type TestContext = { after: typeof test.after diff --git a/templates/eject-ts/server.ts b/templates/eject-ts/server.ts index 55d23ff7..a2ece791 100644 --- a/templates/eject-ts/server.ts +++ b/templates/eject-ts/server.ts @@ -1,12 +1,12 @@ // Read the .env file. import * as dotenv from 'dotenv' -dotenv.config() // Require the framework import Fastify from 'fastify' // Require library to exit fastify process, gracefully (if possible) import closeWithGrace from 'close-with-grace' +dotenv.config() // Instantiate Fastify with some config const app = Fastify({ diff --git a/test/templates/app-ts.test.ts b/test/templates/app-ts.test.ts index 770b13bb..383e2e80 100644 --- a/test/templates/app-ts.test.ts +++ b/test/templates/app-ts.test.ts @@ -1,9 +1,9 @@ -import { fastify } from 'fastify'; -import { test, TestContext } from 'node:test'; -const sgetOriginal = require('simple-get').concat +import { fastify } from 'fastify' +import { test, TestContext } from 'node:test' -import { AddressInfo } from "net"; -import appDefault, { app } from '../../templates/app-ts/src/app'; +import { AddressInfo } from 'net' +import appDefault, { app } from '../../templates/app-ts/src/app' +const sgetOriginal = require('simple-get').concat const sget = (opts: Record): Record => { return new Promise((resolve, reject) => { @@ -14,42 +14,42 @@ const sget = (opts: Record): Record => { }) } -test('should print routes for TS app', async (t: TestContext) => { - t.plan(4) +test('should print routes for TS app', async (t: TestContext) => { + t.plan(4) const fastifyApp = fastify({}) await app(fastifyApp, {}) await fastifyApp.ready() await fastifyApp.listen({ port: 3000 }) - const { response, body } = await sget({ - method: 'GET', - url: `http://localhost:${(fastifyApp.server.address() as AddressInfo).port}` - }) - t.assert.equal(response.statusCode, 200) - t.assert.equal(response.headers['content-length'], '' + body.length) - t.assert.deepStrictEqual(JSON.parse(body), { root: true }) + const { response, body } = await sget({ + method: 'GET', + url: `http://localhost:${(fastifyApp.server.address() as AddressInfo).port}` + }) + t.assert.equal(response.statusCode, 200) + t.assert.equal(response.headers['content-length'], '' + body.length) + t.assert.deepStrictEqual(JSON.parse(body), { root: true }) - await fastifyApp.close(); - t.assert.ok('server closed') + await fastifyApp.close() + t.assert.ok('server closed') }) test('should print routes for default TS app', async (t: TestContext) => { - t.plan(4) + t.plan(4) const fastifyApp = fastify({}) await appDefault(fastifyApp, {}) await fastifyApp.ready() await fastifyApp.listen({ port: 3000 }) - const { response, body } = await sget({ - method: 'GET', - url: `http://localhost:${(fastifyApp.server.address() as AddressInfo).port}` - }) - t.assert.equal(response.statusCode, 200) - t.assert.equal(response.headers['content-length'], '' + body.length) - t.assert.deepStrictEqual(JSON.parse(body), { root: true }) + const { response, body } = await sget({ + method: 'GET', + url: `http://localhost:${(fastifyApp.server.address() as AddressInfo).port}` + }) + t.assert.equal(response.statusCode, 200) + t.assert.equal(response.headers['content-length'], '' + body.length) + t.assert.deepStrictEqual(JSON.parse(body), { root: true }) - await fastifyApp.close(); - t.assert.ok('server closed') + await fastifyApp.close() + t.assert.ok('server closed') }) From 95ce0aca239dad9c0145759bfaf7391fd8c57f16 Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Mon, 16 Dec 2024 20:18:15 +0000 Subject: [PATCH 4/5] Update package.json Signed-off-by: Frazer Smith --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 77336435..e0f534e1 100644 --- a/package.json +++ b/package.json @@ -73,6 +73,7 @@ "c8": "^10.1.2", "concurrently": "^9.0.0", "cross-env": "^7.0.3", + "eslint": "^9.17.0", "fastify-tsconfig": "^3.0.0", "glob": "^11.0.1", "minimatch": "^9.0.5", From 0d900d763a4d8ce17b557e0ddd85876f3497935a Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Sat, 11 Jan 2025 16:58:04 +0000 Subject: [PATCH 5/5] 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) {