mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 22:08:26 +00:00
chore: Enable more lint rules, disable some that trigger a lot. Will clean up later.
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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[] = [];
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user