Oliver JΓ€gle
commited on
Don't fix linting-issues pre-commit
Browse filesI 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 +17 -1
- app/lib/.server/llm/stream-text.ts +2 -2
.husky/pre-commit
CHANGED
@@ -1 +1,17 @@
|
|
1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
5 |
import { getModel } from '~/lib/.server/llm/model';
|
6 |
import { MAX_TOKENS } from './constants';
|
7 |
import { getSystemPrompt } from './prompts';
|
8 |
-
import {
|
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;
|