Skip to content

Commit 8b16962

Browse files
masonwyatt23claude
andcommitted
style: fix lint errors across codebase
- Replace require() with dynamic import() in swift build test - Fix empty catch block with comment - Remove unnecessary escape characters in regex patterns - prefer-const auto-fix in state-extractor Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8862467 commit 8b16962

4 files changed

Lines changed: 5 additions & 6 deletions

File tree

src/analyzer/state-extractor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ function extractServerState(sourceFile: SourceFile, filePath: string): Extracted
535535

536536
const exprText = node.getExpression().getText();
537537
let library: 'react-query' | 'swr' | undefined;
538-
let hookName = exprText;
538+
const hookName = exprText;
539539

540540
if (
541541
exprText === 'useQuery' ||

src/semantic/builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ const AI_CALL_TIMEOUT_MS = 30_000;
165165
function sanitizeErrorMessage(err: unknown): string {
166166
const msg = err instanceof Error ? err.message : String(err);
167167
// Redact API key patterns: xai-..., sk-..., Bearer tokens
168-
return msg.replace(/\b(xai-|sk-|Bearer\s+)[A-Za-z0-9_\-]{8,}/g, '$1[REDACTED]');
168+
return msg.replace(/\b(xai-|sk-|Bearer\s+)[A-Za-z0-9_-]{8,}/g, '$1[REDACTED]');
169169
}
170170

171171
/**

test/e2e/full-pipeline.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ describe('Full Pipeline E2E', { timeout: 30_000 }, () => {
9696

9797
test('generated project compiles with swift build', async () => {
9898
// Check if swift toolchain is available
99+
const { execSync } = await import('child_process');
99100
let hasSwift = false;
100101
try {
101-
const { execSync } = require('child_process');
102102
execSync('which swift', { stdio: 'pipe' });
103103
hasSwift = true;
104-
} catch {}
104+
} catch (_) { /* swift not installed */ }
105105

106106
if (!hasSwift) {
107107
console.log('Swift toolchain not found — skipping compilation test');
@@ -123,7 +123,6 @@ describe('Full Pipeline E2E', { timeout: 30_000 }, () => {
123123

124124
// Run swift build on the generated project
125125
try {
126-
const { execSync } = require('child_process');
127126
const projectRoot = join(testOutput, '..');
128127
execSync('swift build', {
129128
cwd: projectRoot,

test/semantic/builder.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function makeRoute(urlPath: string, pagePath: string, opts: Partial<ExtractedRou
1616
urlPath,
1717
segments: urlPath.split('/').filter(Boolean).map(s => ({
1818
raw: s,
19-
name: s.replace(/[\[\]\.]/g, ''),
19+
name: s.replace(/[[\].]/g, ''),
2020
kind: s.startsWith('[') ? 'dynamic' as const : 'static' as const,
2121
})),
2222
files: { page: pagePath, layout: undefined, loading: undefined, error: undefined, notFound: undefined, template: undefined },

0 commit comments

Comments
 (0)