Skip to content

Commit 0bbeeb9

Browse files
DeRaowlclaude
andcommitted
fix(percy): use const for session state in percy-session
Resolves prefer-const lint failure on CI. The `session` object is never reassigned — only its properties are mutated — so `const` is correct. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b70e273 commit 0bbeeb9

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

src/lib/percy-api/percy-session.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export interface PercySessionState {
2424
orgId?: string;
2525
}
2626

27-
let session: PercySessionState = {};
27+
const session: PercySessionState = {};
2828

2929
// ── Setters ─────────────────────────────────────────────────────────────────
3030

@@ -94,11 +94,9 @@ export function formatActiveBuild(): string {
9494
let out = `\n### Active Build\n\n`;
9595
out += `| | |\n|---|---|\n`;
9696
out += `| **Build ID** | ${session.buildId} |\n`;
97-
if (session.buildNumber)
98-
out += `| **Build #** | ${session.buildNumber} |\n`;
97+
if (session.buildNumber) out += `| **Build #** | ${session.buildNumber} |\n`;
9998
if (session.buildUrl) out += `| **URL** | ${session.buildUrl} |\n`;
100-
if (session.buildBranch)
101-
out += `| **Branch** | ${session.buildBranch} |\n`;
99+
if (session.buildBranch) out += `| **Branch** | ${session.buildBranch} |\n`;
102100
return out;
103101
}
104102

@@ -108,9 +106,7 @@ export function formatSessionSummary(): string {
108106
const masked = session.projectToken
109107
? `****${session.projectToken.slice(-4)}`
110108
: "";
111-
parts.push(
112-
`**Project:** ${session.projectName} (${masked})`,
113-
);
109+
parts.push(`**Project:** ${session.projectName} (${masked})`);
114110
}
115111
if (session.buildId) {
116112
parts.push(

0 commit comments

Comments
 (0)