Skip to content

Commit c5a5282

Browse files
chore: fix linting
1 parent 2420380 commit c5a5282

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

README.md

+11-15
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const options = {
2222
},
2323
};
2424

25-
export const handler: Handler = async (request, reply) => {}
25+
export const handler: Handler = async (request, reply) => {};
2626
```
2727

2828
More options are available
@@ -63,8 +63,8 @@ Running `npx fastify-schema-to-typescript` will convert `schema.yaml` to `schema
6363
app.ts
6464
6565
```ts
66-
import fastify from 'fastify';
67-
import { healthcheck } from './api'
66+
import fastify from "fastify";
67+
import { healthcheck } from "./api";
6868
6969
export async function run() {
7070
const app = fastify();
@@ -79,41 +79,37 @@ run();
7979
api/index.ts
8080

8181
```ts
82-
export * from './healthcheck';
82+
export * from "./healthcheck";
8383
```
8484

8585
api/healtheck/schema.yaml
8686

8787
```yml
8888
headers:
8989
type: object
90-
properties:
91-
...
90+
properties: ...
9291

9392
body:
9493
type: object
95-
properties:
96-
...
94+
properties: ...
9795

9896
query:
9997
type: object
100-
properties:
101-
...
98+
properties: ...
10299

103100
params:
104101
type: object
105-
properties:
106-
...
102+
properties: ...
107103
```
108104
109105
api/healtheck/index.ts
110106
111107
```ts
112-
import { FastifyPluginAsync } from 'fastify';
113-
import { RouteGeneric, schema } from './schema';
108+
import { FastifyPluginAsync } from "fastify";
109+
import { RouteGeneric, schema } from "./schema";
114110

115111
export const getHealthcheck: FastifyPluginAsync = async (app) => {
116-
app.get<RouteGeneric>('/healthcheck', { schema }, async () => {
112+
app.get<RouteGeneric>("/healthcheck", { schema }, async () => {
117113
return { ok: true };
118114
});
119115
};

0 commit comments

Comments
 (0)