From a1557193b389941cb15abf29aa3949e89ab97586 Mon Sep 17 00:00:00 2001 From: Joshua Snyder Date: Wed, 23 Jul 2025 15:13:08 +0200 Subject: [PATCH 1/2] commit bad things --- .husky/pre-commit | 13 +++++++++++++ package.json | 2 +- typescript/src/tools/types.ts | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 7d7d430..c5a78b5 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,2 +1,15 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +# Run formatters and linters pnpm run lint:fix pnpm run format + +# Check if anything changed +if ! git diff --quiet; then + # Stage changed files + git diff --name-only | xargs git add + + echo "❌ Code was auto-fixed. Changes were staged. Please commit again." + exit 1 +fi \ No newline at end of file diff --git a/package.json b/package.json index 2c352df..15dc242 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "deploy": "wrangler deploy", "dev": "wrangler dev", "format": "biome format --write", - "lint:fix": "biome lint --fix", + "lint:fix": "biome lint --write", "test": "vitest", "test:integration": "vitest run --config vitest.integration.config.mts", "test:watch": "vitest watch", diff --git a/typescript/src/tools/types.ts b/typescript/src/tools/types.ts index 7b3429d..ca08f11 100644 --- a/typescript/src/tools/types.ts +++ b/typescript/src/tools/types.ts @@ -10,6 +10,7 @@ export type State = { export type Context = { api: ApiClient; + cache: ScopedCache; env: Env; getProjectId: () => Promise; From e30fc8c2e938bf6f2d70a11ff5954d7609ac6234 Mon Sep 17 00:00:00 2001 From: Joshua Snyder Date: Wed, 23 Jul 2025 15:14:44 +0200 Subject: [PATCH 2/2] try fix instead of fai; --- .husky/pre-commit | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index c5a78b5..2739eea 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -5,11 +5,11 @@ pnpm run lint:fix pnpm run format -# Check if anything changed -if ! git diff --quiet; then - # Stage changed files - git diff --name-only | xargs git add - - echo "❌ Code was auto-fixed. Changes were staged. Please commit again." - exit 1 -fi \ No newline at end of file +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +pnpm run lint:fix +pnpm run format + +# Stage any modified files after formatting/linting +git diff --name-only | xargs git add \ No newline at end of file