chore: Enable `no-unnecessary-template-expression` lint rule.
parent
87a61c3b88
commit
baa1e95b9d
|
|
@ -15,7 +15,6 @@
|
|||
"oxc/no-async-endpoint-handlers": "off",
|
||||
"oxc/no-map-spread": "off",
|
||||
"typescript/no-extraneous-class": "off",
|
||||
"typescript/no-unnecessary-template-expression": "off",
|
||||
"typescript/no-unsafe-type-assertion": "off",
|
||||
"unicorn/consistent-function-scoping": "off",
|
||||
"unicorn/require-post-message-target-origin": "off"
|
||||
|
|
|
|||
|
|
@ -119,22 +119,22 @@ export class TwitchClientManager {
|
|||
log: (level, message) => {
|
||||
switch (level) {
|
||||
case LogLevel.CRITICAL:
|
||||
this.logger.error(`${message}`);
|
||||
this.logger.error(message);
|
||||
break;
|
||||
case LogLevel.ERROR:
|
||||
this.logger.error(`${message}`);
|
||||
this.logger.error(message);
|
||||
break;
|
||||
case LogLevel.WARNING:
|
||||
this.logger.warn(`${message}`);
|
||||
this.logger.warn(message);
|
||||
break;
|
||||
case LogLevel.INFO:
|
||||
this.logger.info(`${message}`);
|
||||
this.logger.info(message);
|
||||
break;
|
||||
case LogLevel.DEBUG:
|
||||
this.logger.debug?.(`${message}`);
|
||||
this.logger.debug?.(message);
|
||||
break;
|
||||
case LogLevel.TRACE:
|
||||
this.logger.debug?.(`${message}`);
|
||||
this.logger.debug?.(message);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1458,8 +1458,7 @@ export function createExecTool(
|
|||
{
|
||||
type: "text",
|
||||
text:
|
||||
`${warningText}` +
|
||||
`Approval required (id ${approvalSlug}). ` +
|
||||
`${warningText}Approval required (id ${approvalSlug}). ` +
|
||||
"Approve to run; updates will arrive after completion.",
|
||||
},
|
||||
],
|
||||
|
|
@ -1541,12 +1540,9 @@ export function createExecTool(
|
|||
content: [
|
||||
{
|
||||
type: "text",
|
||||
text:
|
||||
`${getWarningText()}` +
|
||||
`Command still running (session ${run.session.id}, pid ${
|
||||
run.session.pid ?? "n/a"
|
||||
}). ` +
|
||||
"Use process (list/poll/log/write/kill/clear/remove) for follow-up.",
|
||||
text: `${getWarningText()}Command still running (session ${run.session.id}, pid ${
|
||||
run.session.pid ?? "n/a"
|
||||
}). Use process (list/poll/log/write/kill/clear/remove) for follow-up.`,
|
||||
},
|
||||
],
|
||||
details: {
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ export function registerDirectoryCli(program: Command) {
|
|||
return;
|
||||
}
|
||||
const tableWidth = Math.max(60, (process.stdout.columns ?? 120) - 1);
|
||||
defaultRuntime.log(`${theme.heading("Self")}`);
|
||||
defaultRuntime.log(theme.heading("Self"));
|
||||
defaultRuntime.log(
|
||||
renderTable({
|
||||
width: tableWidth,
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ export async function appendStatusAllDiagnosis(params: {
|
|||
};
|
||||
|
||||
lines.push("");
|
||||
lines.push(`${muted("Gateway connection details:")}`);
|
||||
lines.push(muted("Gateway connection details:"));
|
||||
for (const line of redactSecrets(params.connectionDetailsForReport)
|
||||
.split("\n")
|
||||
.map((l) => l.trimEnd())) {
|
||||
|
|
@ -116,7 +116,7 @@ export async function appendStatusAllDiagnosis(params: {
|
|||
const isTrivialLastErr = lastErrClean.length < 8 || lastErrClean === "}" || lastErrClean === "{";
|
||||
if (lastErrClean && !isTrivialLastErr) {
|
||||
lines.push("");
|
||||
lines.push(`${muted("Gateway last log line:")}`);
|
||||
lines.push(muted("Gateway last log line:"));
|
||||
lines.push(` ${muted(redactSecrets(lastErrClean))}`);
|
||||
}
|
||||
|
||||
|
|
@ -179,7 +179,7 @@ export async function appendStatusAllDiagnosis(params: {
|
|||
]);
|
||||
if (stderrTail.length > 0 || stdoutTail.length > 0) {
|
||||
lines.push("");
|
||||
lines.push(`${muted(`Gateway logs (tail, summarized): ${logPaths.logDir}`)}`);
|
||||
lines.push(muted(`Gateway logs (tail, summarized): ${logPaths.logDir}`));
|
||||
lines.push(` ${muted(`# stderr: ${logPaths.stderrPath}`)}`);
|
||||
for (const line of summarizeLogTail(stderrTail, { maxLines: 22 }).map(redactSecrets)) {
|
||||
lines.push(` ${muted(line)}`);
|
||||
|
|
@ -236,7 +236,7 @@ export async function appendStatusAllDiagnosis(params: {
|
|||
})();
|
||||
if (healthErr) {
|
||||
lines.push("");
|
||||
lines.push(`${muted("Gateway health:")}`);
|
||||
lines.push(muted("Gateway health:"));
|
||||
lines.push(` ${muted(redactSecrets(healthErr))}`);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -265,8 +265,7 @@ export async function runCronIsolatedAgentTurn(params: {
|
|||
if (suspiciousPatterns.length > 0) {
|
||||
logWarn(
|
||||
`[security] Suspicious patterns detected in external hook content ` +
|
||||
`(session=${baseSessionKey}, patterns=${suspiciousPatterns.length}): ` +
|
||||
`${suspiciousPatterns.slice(0, 3).join(", ")}`,
|
||||
`(session=${baseSessionKey}, patterns=${suspiciousPatterns.length}): ${suspiciousPatterns.slice(0, 3).join(", ")}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -355,7 +355,7 @@ export async function uninstallLaunchAgent({
|
|||
}
|
||||
|
||||
function isLaunchctlNotLoaded(res: { stdout: string; stderr: string; code: number }): boolean {
|
||||
const detail = `${res.stderr || res.stdout}`.toLowerCase();
|
||||
const detail = (res.stderr || res.stdout).toLowerCase();
|
||||
return (
|
||||
detail.includes("no such process") ||
|
||||
detail.includes("could not find service") ||
|
||||
|
|
|
|||
|
|
@ -327,7 +327,7 @@ export async function uninstallScheduledTask({
|
|||
}
|
||||
|
||||
function isTaskNotRunning(res: { stdout: string; stderr: string; code: number }): boolean {
|
||||
const detail = `${res.stderr || res.stdout}`.toLowerCase();
|
||||
const detail = (res.stderr || res.stdout).toLowerCase();
|
||||
return detail.includes("not running");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -387,7 +387,7 @@ async function isSystemctlAvailable(): Promise<boolean> {
|
|||
if (res.code === 0) {
|
||||
return true;
|
||||
}
|
||||
const detail = `${res.stderr || res.stdout}`.toLowerCase();
|
||||
const detail = (res.stderr || res.stdout).toLowerCase();
|
||||
return !detail.includes("not found");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ export function describeReplyTarget(msg: TelegramMessage): TelegramReplyTarget |
|
|||
return null;
|
||||
}
|
||||
const sender = reply ? buildSenderName(reply) : undefined;
|
||||
const senderLabel = sender ? `${sender}` : "unknown sender";
|
||||
const senderLabel = sender ?? "unknown sender";
|
||||
|
||||
return {
|
||||
id: reply?.message_id ? String(reply.message_id) : undefined,
|
||||
|
|
|
|||
Loading…
Reference in New Issue