chore: Enable more lint rules, disable some that trigger a lot. Will clean up later.

This commit is contained in:
cpojer
2026-01-31 16:03:28 +09:00
parent 481f696a87
commit 15792b153f
292 changed files with 643 additions and 699 deletions

View File

@@ -20,7 +20,7 @@ function listConfiguredAccountIds(cfg: OpenClawConfig): string[] {
export function listSignalAccountIds(cfg: OpenClawConfig): string[] {
const ids = listConfiguredAccountIds(cfg);
if (ids.length === 0) return [DEFAULT_ACCOUNT_ID];
return ids.sort((a, b) => a.localeCompare(b));
return ids.toSorted((a, b) => a.localeCompare(b));
}
export function resolveDefaultSignalAccountId(cfg: OpenClawConfig): string {

View File

@@ -53,7 +53,7 @@ function mapStyle(style: MarkdownStyle): SignalTextStyle | null {
}
function mergeStyles(styles: SignalTextStyleRange[]): SignalTextStyleRange[] {
const sorted = [...styles].sort((a, b) => {
const sorted = [...styles].toSorted((a, b) => {
if (a.start !== b.start) return a.start - b.start;
if (a.length !== b.length) return a.length - b.length;
return a.style.localeCompare(b.style);
@@ -90,7 +90,7 @@ function applyInsertionsToStyles(
insertions: Insertion[],
): SignalStyleSpan[] {
if (insertions.length === 0) return spans;
const sortedInsertions = [...insertions].sort((a, b) => a.pos - b.pos);
const sortedInsertions = [...insertions].toSorted((a, b) => a.pos - b.pos);
let updated = spans;
for (const insertion of sortedInsertions) {
@@ -137,7 +137,7 @@ function renderSignalText(ir: MarkdownIR): SignalFormattedText {
const text = ir.text ?? "";
if (!text) return { text: "", styles: [] };
const sortedLinks = [...ir.links].sort((a, b) => a.start - b.start);
const sortedLinks = [...ir.links].toSorted((a, b) => a.start - b.start);
let out = "";
let cursor = 0;
const insertions: Insertion[] = [];

View File

@@ -36,7 +36,7 @@ export async function probeSignal(baseUrl: string, timeoutMs: number): Promise<S
};
}
try {
const version = await signalRpcRequest<unknown>("version", undefined, {
const version = await signalRpcRequest("version", undefined, {
baseUrl,
timeoutMs,
});