Skip to content

Commit

Permalink
Don't fix linting-issues pre-commit
Browse files Browse the repository at this point in the history
I figured that lint:fix might not be the best experience: If there are linting errors and the pre-commit fixes them, those changes will stay in the staging area but will not be automatically commited.
Thus, a subsequent pre-commit check would succeed without these changes included.
  • Loading branch information
mrsimpson committed Nov 23, 2024
1 parent 17d0902 commit ad511db
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
18 changes: 17 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
pnpm lint:fix
#!/bin/sh

echo "🔍 Running pre-commit hook to check the code looks good... 🔍"

if ! pnpm typecheck; then
echo "❌ Type checking failed! Please review TypeScript types."
echo "Once you're done, don't forget to add your changes to the commit! 🚀"
exit 1
fi

if ! pnpm lint; then
echo "❌ Linting failed! 'pnpm lint:check' will help you fix the easy ones."
echo "Once you're done, don't forget to add your beautification to the commit! 🤩"
exit 1
fi

echo "👍 All good! Committing changes..."
4 changes: 2 additions & 2 deletions app/lib/.server/llm/stream-text.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-nocheck – TODO: Provider proper types

import { streamText as _streamText, convertToCoreMessages } from 'ai';
import { convertToCoreMessages, streamText as _streamText } from 'ai';
import { getModel } from '~/lib/.server/llm/model';
import { MAX_TOKENS } from './constants';
import { getSystemPrompt } from './prompts';
import { MODEL_LIST, DEFAULT_MODEL, DEFAULT_PROVIDER, MODEL_REGEX, PROVIDER_REGEX } from '~/utils/constants';
import { DEFAULT_MODEL, DEFAULT_PROVIDER, MODEL_LIST, MODEL_REGEX, PROVIDER_REGEX } from '~/utils/constants';

interface ToolResult<Name extends string, Args, Result> {
toolCallId: string;
Expand Down

0 comments on commit ad511db

Please sign in to comment.