Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbbreuer committed Oct 24, 2024
1 parent d534f1e commit 76b0dc5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ You may now use the plugin:
```ts
// index.ts
import type { AutoImportsOptions } from 'bun-plugin-auto-imports'
import { plugin } from 'bun'
import { autoImports } from 'bun-plugin-auto-imports'
import { plugin } from "bun"

const options: AutoImportsOptions = {
presets: ["solid-js"], // any unimport presets are valid
imports: [{ name: "z", from: "zod" }],
presets: ['solid-js'], // any unimport presets are valid
imports: [{ name: 'z', from: 'zod' }],
dts: `./src/auto-import.d.ts`, // default is `./auto-import.d.ts`
}

plugin(autoImports(options))

Bun.serve({
fetch: handler,
port: 3000,
fetch: handler,
port: 3000,
})
```

Expand All @@ -49,14 +49,15 @@ const Body = z.object({
msg: z.string(),
})

export const handler = async (req: Request) => {
export async function handler(req: Request) {
try {
const body = await req.json()
const data = Body.parse(body)

return new Response(`Received: ${data.msg}`)
} catch (e) {
return new Response("Invalid body", { status: 400 })
}
catch (e) {
return new Response('Invalid body', { status: 400 })
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"typecheck": "bun tsc --noEmit"
},
"dependencies": {
"unimport": "^3.13.1"
"unimport": "^3.13.1"
},
"devDependencies": {
"@stacksjs/eslint-config": "^3.8.1-beta.2",
Expand Down

0 comments on commit 76b0dc5

Please sign in to comment.