From 14e53da68d1c51097d9a70e435a369c384b7a54f Mon Sep 17 00:00:00 2001 From: davipon Date: Tue, 24 May 2022 21:35:59 +0800 Subject: [PATCH] chore: change import type syntax --- src/routes/v1/bad-request/index.ts | 2 +- src/routes/v1/examples/index.ts | 2 +- src/routes/v1/posts/handler.ts | 8 +------- src/routes/v1/posts/index.ts | 2 +- src/routes/v1/posts/schema.ts | 2 +- src/routes/v2/examples/index.ts | 2 +- 6 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/routes/v1/bad-request/index.ts b/src/routes/v1/bad-request/index.ts index 10d1cc8..af57fb0 100644 --- a/src/routes/v1/bad-request/index.ts +++ b/src/routes/v1/bad-request/index.ts @@ -1,4 +1,4 @@ -import { FastifyPluginAsync } from 'fastify' +import type { FastifyPluginAsync } from 'fastify' const badRequest: FastifyPluginAsync = async (fastify): Promise => { // Note: using an arrow function will break the binding of this to the FastifyInstance. diff --git a/src/routes/v1/examples/index.ts b/src/routes/v1/examples/index.ts index 212c1fb..d11399b 100644 --- a/src/routes/v1/examples/index.ts +++ b/src/routes/v1/examples/index.ts @@ -1,4 +1,4 @@ -import { FastifyPluginAsync } from 'fastify' +import type { FastifyPluginAsync } from 'fastify' const example: FastifyPluginAsync = async (fastify): Promise => { // Note: using an arrow function will break the binding of this to the FastifyInstance. diff --git a/src/routes/v1/posts/handler.ts b/src/routes/v1/posts/handler.ts index ffaa0b6..0f14506 100644 --- a/src/routes/v1/posts/handler.ts +++ b/src/routes/v1/posts/handler.ts @@ -1,11 +1,5 @@ import { type RouteHandler } from 'fastify' -import { - type Params, - type Querystring, - type Body, - type Reply, - type PostNotFound -} from './schema' +import type { Params, Querystring, Body, Reply, PostNotFound } from './schema' import { posts } from './posts' export const getPostsHandler: RouteHandler<{ diff --git a/src/routes/v1/posts/index.ts b/src/routes/v1/posts/index.ts index 928514e..ecb6265 100644 --- a/src/routes/v1/posts/index.ts +++ b/src/routes/v1/posts/index.ts @@ -1,4 +1,4 @@ -import { type FastifyInstance } from 'fastify' +import type { FastifyInstance } from 'fastify' import { postSchema, postNotFoundSchema, diff --git a/src/routes/v1/posts/schema.ts b/src/routes/v1/posts/schema.ts index dd89e42..c3e401b 100644 --- a/src/routes/v1/posts/schema.ts +++ b/src/routes/v1/posts/schema.ts @@ -1,4 +1,4 @@ -import { FastifySchema } from 'fastify' +import type { FastifySchema } from 'fastify' import { FromSchema } from 'json-schema-to-ts' // Shared Schema diff --git a/src/routes/v2/examples/index.ts b/src/routes/v2/examples/index.ts index 4edc3b4..29231c9 100644 --- a/src/routes/v2/examples/index.ts +++ b/src/routes/v2/examples/index.ts @@ -1,4 +1,4 @@ -import { FastifyPluginAsync } from 'fastify' +import type { FastifyPluginAsync } from 'fastify' const example: FastifyPluginAsync = async (fastify): Promise => { // Note: using an arrow function will break the binding of this to the FastifyInstance.