style: add prettier
Summary: Test Plan:
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -4,7 +4,4 @@ dist
|
|||||||
.dev.vars
|
.dev.vars
|
||||||
|
|
||||||
# Change them to your taste:
|
# Change them to your taste:
|
||||||
package-lock.json
|
|
||||||
yarn.lock
|
|
||||||
pnpm-lock.yaml
|
|
||||||
bun.lockb
|
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
|
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": {
|
"devDependencies": {
|
||||||
"@cloudflare/workers-types": "^4.20240403.0",
|
"@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"
|
"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) => {
|
app.get("/", (c) => {
|
||||||
return c.text('Hello Hono!')
|
return c.text("Hello Hono!");
|
||||||
})
|
});
|
||||||
|
|
||||||
export default app
|
export default app;
|
||||||
|
|||||||
@@ -5,13 +5,9 @@
|
|||||||
"moduleResolution": "Bundler",
|
"moduleResolution": "Bundler",
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"lib": [
|
"lib": ["ESNext"],
|
||||||
"ESNext"
|
"types": ["@cloudflare/workers-types"],
|
||||||
],
|
|
||||||
"types": [
|
|
||||||
"@cloudflare/workers-types"
|
|
||||||
],
|
|
||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
"jsxImportSource": "hono/jsx"
|
"jsxImportSource": "hono/jsx"
|
||||||
},
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user