Skip to content

Commit c95427b

Browse files
committed
chore: fix lint debt blocking pre-push
- claude-code-config.ts: merge concatenated strings into one template literal (useTemplate) and wrap long conditional per formatter. - declare-tweak-schema.test.ts: replace non-null assertions with optional chains (noNonNullAssertion). All changes are biome check --fix --unsafe output. No behavior change.
1 parent 05a3b62 commit c95427b

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

apps/desktop/src/main/imports/claude-code-config.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,13 @@ export function parseClaudeCodeSettings(
135135
}
136136
}
137137

138-
if (apiKey === null && typeof settings.apiKeyHelper === 'string' && settings.apiKeyHelper.length > 0) {
138+
if (
139+
apiKey === null &&
140+
typeof settings.apiKeyHelper === 'string' &&
141+
settings.apiKeyHelper.length > 0
142+
) {
139143
warnings.push(
140-
`Claude Code settings.json defines apiKeyHelper ("${settings.apiKeyHelper}"). ` +
141-
'Open CoDesign does not execute helper scripts — please paste a key manually, ' +
142-
'or export ANTHROPIC_API_KEY in your shell before launching from terminal.',
144+
`Claude Code settings.json defines apiKeyHelper ("${settings.apiKeyHelper}"). Open CoDesign does not execute helper scripts — please paste a key manually, or export ANTHROPIC_API_KEY in your shell before launching from terminal.`,
143145
);
144146
}
145147

packages/core/src/tools/declare-tweak-schema.test.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ describe('declare_tweak_schema tool', () => {
4646
expect(res.details.status).toBe('ok');
4747
expect(res.details.errors).toEqual([]);
4848
const after = fs.view('index.html');
49-
expect(after).not.toBeNull();
50-
expect(parseTweakSchema(after!.content)).toEqual({
49+
if (!after) throw new Error('expected index.html to exist');
50+
expect(parseTweakSchema(after.content)).toEqual({
5151
accent: { kind: 'color' },
5252
radius: { kind: 'number', min: 0, max: 32, step: 2, unit: 'px' },
5353
});
@@ -63,7 +63,9 @@ describe('declare_tweak_schema tool', () => {
6363
schema: { accent: { kind: 'string', placeholder: 'hex' } },
6464
});
6565
expect(res.details.status).toBe('ok');
66-
const content = fs.view('index.html')!.content;
66+
const view = fs.view('index.html');
67+
if (!view) throw new Error('expected index.html to exist');
68+
const content = view.content;
6769
expect(content.match(/TWEAK-SCHEMA-BEGIN/g)?.length).toBe(1);
6870
expect(parseTweakSchema(content)).toEqual({
6971
accent: { kind: 'string', placeholder: 'hex' },
@@ -83,7 +85,9 @@ describe('declare_tweak_schema tool', () => {
8385
expect(res.details.status).toBe('error');
8486
expect(res.details.errors.some((e) => e.message.includes('"bad"'))).toBe(true);
8587
// The good entry still landed in the file.
86-
expect(parseTweakSchema(fs.view('index.html')!.content)).toEqual({
88+
const view = fs.view('index.html');
89+
if (!view) throw new Error('expected index.html to exist');
90+
expect(parseTweakSchema(view.content)).toEqual({
8791
good: { kind: 'color' },
8892
});
8993
});

0 commit comments

Comments
 (0)