Oliver JΓ€gle commited on
Commit
ad511db
Β·
unverified Β·
1 Parent(s): 17d0902

Don't fix linting-issues pre-commit

Browse files

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.

.husky/pre-commit CHANGED
@@ -1 +1,17 @@
1
- pnpm lint:fix
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+
3
+ echo "πŸ” Running pre-commit hook to check the code looks good... πŸ”"
4
+
5
+ if ! pnpm typecheck; then
6
+ echo "❌ Type checking failed! Please review TypeScript types."
7
+ echo "Once you're done, don't forget to add your changes to the commit! πŸš€"
8
+ exit 1
9
+ fi
10
+
11
+ if ! pnpm lint; then
12
+ echo "❌ Linting failed! 'pnpm lint:check' will help you fix the easy ones."
13
+ echo "Once you're done, don't forget to add your beautification to the commit! 🀩"
14
+ exit 1
15
+ fi
16
+
17
+ echo "πŸ‘ All good! Committing changes..."
app/lib/.server/llm/stream-text.ts CHANGED
@@ -1,11 +1,11 @@
1
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2
  // @ts-nocheck – TODO: Provider proper types
3
 
4
- import { streamText as _streamText, convertToCoreMessages } from 'ai';
5
  import { getModel } from '~/lib/.server/llm/model';
6
  import { MAX_TOKENS } from './constants';
7
  import { getSystemPrompt } from './prompts';
8
- import { MODEL_LIST, DEFAULT_MODEL, DEFAULT_PROVIDER, MODEL_REGEX, PROVIDER_REGEX } from '~/utils/constants';
9
 
10
  interface ToolResult<Name extends string, Args, Result> {
11
  toolCallId: string;
 
1
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
2
  // @ts-nocheck – TODO: Provider proper types
3
 
4
+ import { convertToCoreMessages, streamText as _streamText } from 'ai';
5
  import { getModel } from '~/lib/.server/llm/model';
6
  import { MAX_TOKENS } from './constants';
7
  import { getSystemPrompt } from './prompts';
8
+ import { DEFAULT_MODEL, DEFAULT_PROVIDER, MODEL_LIST, MODEL_REGEX, PROVIDER_REGEX } from '~/utils/constants';
9
 
10
  interface ToolResult<Name extends string, Args, Result> {
11
  toolCallId: string;