Featuring:
- TypeScript support
- Prettier auto-formatting
- auto-removal of unused imports
- auto-sorting of all imports
- auto-consolidation of imports
type GlobalCtx = { | |
session: { | |
authorize(): void; | |
}; | |
}; | |
type LoginInputType = { | |
email: string; | |
}; |
type Generics = Partial<{ | |
asdf:string; | |
qwer : number; | |
}> | |
type Defaults = Required<{ | |
asdf: 'default'; | |
qwer: 1234; | |
}>; |
// keybindings.json | |
// Command Pallette > Open Keyboard Shortcuts (JSON) | |
[ | |
{ | |
"key": "cmd+shift+l", | |
"command": "editor.action.insertSnippet", | |
"when": "editorTextFocus", | |
"args": { | |
"snippet": "console.log(${TM_SELECTED_TEXT}$1)$0;" |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>user/repo</title> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | |
<meta | |
name="description" | |
content="This is a description of user/repo" | |
/> |
# requires hyperfine and Bun v0.7 or later | |
# https://github.com/sharkdp/hyperfine | |
git clone [email protected]:colinhacks/zod.git | |
cd zod | |
bun install | |
hyperfine --warmup 3 --runs 10 \ | |
"bun test src" \ | |
"npx vitest --config configs/vitest.config.ts" \ | |
"npx jest -c configs/babel-jest.config.json" \ |
{ | |
"name": "sayhi", | |
"module": "index.ts", | |
"type": "module", | |
"dependencies": { | |
"cowsay": "^1.5.0" | |
}, | |
"scripts": { | |
"hi": "echo 'hi'" | |
} |
import { renderToString } from "react-dom/server"; | |
const router = new Bun.FileSystemRouter({ | |
style: "nextjs", | |
dir: "./pages", | |
}); | |
Bun.serve({ | |
port: 3000, | |
development: true, |
import Benchmark from "benchmark"; | |
const datetimeValidationSuite = new Benchmark.Suite("datetime"); | |
const DATA = "2020-01-01"; | |
const MONTHS_31 = new Set([1, 3, 5, 7, 8, 10, 12]); | |
const MONTHS_30 = new Set([4, 6, 9, 11]); | |
const simpleDatetimeRegex = /^(\d{4})-(\d{2})-(\d{2})$/; | |
const datetimeRegexNoLeapYearValidation = |
gh repo clone https://github.com/t3-oss/t3-env t3env | |
cd t3env | |
git checkout @t3-oss/[email protected] | |
pnpm i | |
pnpm update zod --latest --recursive | |
pnpm run build |