style: auto-fix ESLint issues (curly braces and formatting)

- Add curly braces to all if/else/for/while statements
- Fix indentation and trailing spaces
- Auto-fixed 372 linting errors using eslint --fix
- Remaining issues are warnings only (non-null assertions, explicit any types)
This commit is contained in:
William Valentin
2026-02-11 10:30:24 -08:00
parent 0578a87d85
commit 6090508bad
99 changed files with 418 additions and 418 deletions
+6 -6
View File
@@ -115,7 +115,7 @@ export function normalizeMessagesForLlamaCpp(
} else if (block.type === 'tool_use') {
const name = block.name as string;
const id = block.id as string;
if (id) toolNameMap.set(id, name);
if (id) {toolNameMap.set(id, name);}
let argsStr: string;
try {
argsStr = JSON.stringify(block.input);
@@ -321,7 +321,7 @@ export class LlamaCppClient implements ModelClient {
while (true) {
const { done, value } = await reader.read();
if (done) break;
if (done) {break;}
buffer += decoder.decode(value, { stream: true });
const lines = buffer.split('\n');
@@ -329,10 +329,10 @@ export class LlamaCppClient implements ModelClient {
for (const line of lines) {
const trimmed = line.trim();
if (!trimmed || !trimmed.startsWith('data: ')) continue;
if (!trimmed || !trimmed.startsWith('data: ')) {continue;}
const data = trimmed.slice(6);
if (data === '[DONE]') continue;
if (data === '[DONE]') {continue;}
try {
const chunk = JSON.parse(data) as LlamaCppStreamChunk;
@@ -352,8 +352,8 @@ export class LlamaCppClient implements ModelClient {
});
}
const acc = toolCallAccumulators.get(tc.index)!;
if (tc.function?.name) acc.name = tc.function.name;
if (tc.function?.arguments) acc.arguments += tc.function.arguments;
if (tc.function?.name) {acc.name = tc.function.name;}
if (tc.function?.arguments) {acc.arguments += tc.function.arguments;}
}
}
+2 -2
View File
@@ -55,7 +55,7 @@ export function normalizeMessagesForOllama(
} else if (block.type === 'tool_use') {
const name = block.name as string;
const id = block.id as string;
if (id) toolNameMap.set(id, name);
if (id) {toolNameMap.set(id, name);}
toolCalls.push({
function: {
name,
@@ -135,7 +135,7 @@ export class OllamaClient implements ModelClient {
* true (optimistic — let the server decide).
*/
private async checkToolSupport(): Promise<boolean> {
if (this._supportsTools !== null) return this._supportsTools;
if (this._supportsTools !== null) {return this._supportsTools;}
try {
const info = await this.client.show({ model: this.model });
const caps: string[] = (info as any).capabilities ?? [];