mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 18:04:59 +00:00
chore: Enable more lint rules, disable some that trigger a lot. Will clean up later.
This commit is contained in:
@@ -38,7 +38,7 @@ function formatListTop(
|
||||
entries: Array<{ name: string; value: number }>,
|
||||
cap: number,
|
||||
): { lines: string[]; omitted: number } {
|
||||
const sorted = [...entries].sort((a, b) => b.value - a.value);
|
||||
const sorted = [...entries].toSorted((a, b) => b.value - a.value);
|
||||
const top = sorted.slice(0, cap);
|
||||
const omitted = Math.max(0, sorted.length - top.length);
|
||||
const lines = top.map((e) => `- ${e.name}: ${formatCharsAndTokens(e.value)}`);
|
||||
@@ -263,7 +263,7 @@ export async function buildContextReply(params: HandleCommandsParams): Promise<R
|
||||
);
|
||||
const toolPropsLines = report.tools.entries
|
||||
.filter((t) => t.propertiesCount != null)
|
||||
.sort((a, b) => (b.propertiesCount ?? 0) - (a.propertiesCount ?? 0))
|
||||
.toSorted((a, b) => (b.propertiesCount ?? 0) - (a.propertiesCount ?? 0))
|
||||
.slice(0, 30)
|
||||
.map((t) => `- ${t.name}: ${t.propertiesCount} params`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user