style: add prettier
Summary: Test Plan:
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -4,7 +4,4 @@ dist
|
||||
.dev.vars
|
||||
|
||||
# Change them to your taste:
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
pnpm-lock.yaml
|
||||
bun.lockb
|
||||
7
.prettierignore
Normal file
7
.prettierignore
Normal file
@@ -0,0 +1,7 @@
|
||||
# Ignore artifacts:
|
||||
build
|
||||
coverage
|
||||
node_modules
|
||||
bun.lockb
|
||||
.prettierignore
|
||||
.gitignore
|
||||
6
.prettierrc
Normal file
6
.prettierrc
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"plugins": ["@trivago/prettier-plugin-sort-imports", "prettier-plugin-toml"],
|
||||
"importOrder": ["^bun:.+$", "^node:.+$", "^~/.+$", "^[./]"],
|
||||
"importOrderSeparation": true,
|
||||
"importOrderSortSpecifiers": true
|
||||
}
|
||||
@@ -6,3 +6,10 @@ npm run dev
|
||||
```
|
||||
npm run deploy
|
||||
```
|
||||
|
||||
pre-commit hook for Sapling (`.sl/config`):
|
||||
|
||||
```
|
||||
[hooks]
|
||||
precommit = echo $HG_PARENT1 && bun prettier $(sl show -T "{file_adds} {file_mods}\n\n" $HG_PARENT1 --stat | head -n 1) --write
|
||||
```
|
||||
|
||||
@@ -8,6 +8,9 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@cloudflare/workers-types": "^4.20240403.0",
|
||||
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
||||
"prettier": "^3.2.5",
|
||||
"prettier-plugin-toml": "^2.0.1",
|
||||
"wrangler": "^3.47.0"
|
||||
}
|
||||
}
|
||||
|
||||
12
src/index.ts
12
src/index.ts
@@ -1,9 +1,9 @@
|
||||
import { Hono } from 'hono'
|
||||
import { Hono } from "hono";
|
||||
|
||||
const app = new Hono()
|
||||
const app = new Hono();
|
||||
|
||||
app.get('/', (c) => {
|
||||
return c.text('Hello Hono!')
|
||||
})
|
||||
app.get("/", (c) => {
|
||||
return c.text("Hello Hono!");
|
||||
});
|
||||
|
||||
export default app
|
||||
export default app;
|
||||
|
||||
@@ -5,13 +5,9 @@
|
||||
"moduleResolution": "Bundler",
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"lib": [
|
||||
"ESNext"
|
||||
],
|
||||
"types": [
|
||||
"@cloudflare/workers-types"
|
||||
],
|
||||
"lib": ["ESNext"],
|
||||
"types": ["@cloudflare/workers-types"],
|
||||
"jsx": "react-jsx",
|
||||
"jsxImportSource": "hono/jsx"
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,4 +18,4 @@ compatibility_date = "2023-12-01"
|
||||
# database_id = ""
|
||||
|
||||
# [ai]
|
||||
# binding = "AI"
|
||||
# binding = "AI"
|
||||
|
||||
Reference in New Issue
Block a user