Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .changeset/re-enable-lint-rules.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
"@open-codesign/desktop": patch
"@open-codesign/core": patch
"@open-codesign/shared": patch
"@open-codesign/exporters": patch
"@open-codesign/providers": patch
"@open-codesign/artifacts": patch
"@open-codesign/runtime": patch
---

Re-enable remaining demoted lint rules in biome.json (Closes #118):

- Enable `suspicious/noAssignInExpressions` as error; refactor regex-while assignment patterns in pptx.ts
- Enable `complexity/noExcessiveCognitiveComplexity` as error; add inline `biome-ignore` suppressions for 172 pre-existing complexity violations across 82 files
- Enable `complexity/noForEach`, `a11y/useButtonType`, `a11y/useFocusableInteractive`, `a11y/useSemanticElements`, `a11y/noSvgWithoutTitle`, `a11y/useKeyWithClickEvents`, `a11y/useValidAnchor` as error (all clean)
- Fix `a11y/useFocusableInteractive` in CanvasTabBar: add tabIndex to tab elements
- Add `biome-ignore` suppressions for a11y resize handle separators (App.tsx, FilesTabView.tsx) and AskModal section/group
1 change: 1 addition & 0 deletions apps/desktop/scripts/after-pack-prune.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ function unpackedNodeModulesDirs(context) {
);
}

// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: existing complexity, see #118
function koffiTriplet(platform, arch) {
if (platform === 'darwin') {
if (arch === 'arm64') return 'darwin_arm64';
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/src/main/bundled-resources.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function classifyTemplateSource(raw: string): 'html' | 'jsx' | 'css' | 'design-m
}

describe('bundled scaffold resources', () => {
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: existing complexity, see #118
it('keeps scaffold manifest paths aligned with source format', async () => {
const manifest = JSON.parse(
await readFile(join(scaffoldsRoot, 'manifest.json'), 'utf8'),
Expand Down
3 changes: 3 additions & 0 deletions apps/desktop/src/main/connection-ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ function inIpv4Range(ip: string, base: string, bits: number): boolean {
return (value & mask) === (baseValue & mask);
}

// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: existing complexity, see #118
export function classifyNetworkTarget(rawBaseUrl: string): NetworkTargetClass {
let parsed: URL;
try {
Expand Down Expand Up @@ -610,6 +611,7 @@ export async function runProviderTest(
// never weaken TLS for built-in providers. Wrapping the whole body covers
// both the GET /models probe and the inner POST inside tryDegradeProbe.
const bypass = creds.builtin !== true && creds.tlsRejectUnauthorized === true;
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: existing complexity, see #118
return withTlsBypass(bypass, async () => {
const { url, normalizedBaseUrl } = buildEndpointForWire(creds.wire, creds.baseUrl);
const headers = buildAuthHeadersForWire(
Expand Down Expand Up @@ -714,6 +716,7 @@ type ProbeResult =
* request body is intentionally minimal; if the gateway rejects the payload
* shape with a 4xx we still know the route exists.
*/
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: existing complexity, see #118
async function probeInferenceEndpoint(
wire: 'openai-chat' | 'openai-responses' | 'anthropic',
normalizedBaseUrl: string,
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/src/main/document-preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ function parseSharedStrings(sharedStringsXml: string | null): string[] {
return items.map((item) => cleanLine(textRuns(item).join(''))).filter((line) => line.length > 0);
}

// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: existing complexity, see #118
function parseWorksheetRows(xml: string, sharedStrings: string[]): string[] {
const rows = localElementContents(xml, 'row');
const out: string[] = [];
Expand Down
2 changes: 2 additions & 0 deletions apps/desktop/src/main/ensure-user-templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ function canContainEditmodeBlock(filePath: string): boolean {
);
}

// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: existing complexity, see #118
async function repairLegacyEditmodeBlocks(sourceDir: string, destDir: string): Promise<number> {
if (!existsSync(sourceDir) || !existsSync(destDir)) return 0;
let repaired = 0;
Expand Down Expand Up @@ -154,6 +155,7 @@ function patchStringField(
return true;
}

// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: existing complexity, see #118
async function repairScaffoldManifest(sourcePath: string, destPath: string): Promise<number> {
if (!existsSync(sourcePath) || !existsSync(destPath)) return 0;

Expand Down
2 changes: 2 additions & 0 deletions apps/desktop/src/main/exporter-ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export interface ExportResponse {
bytes?: number;
}

// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: existing complexity, see #118
export function parseRequest(raw: unknown): ExportRequest {
if (raw === null || typeof raw !== 'object') {
throw new CodesignError('export expects an object payload', ERROR_CODES.IPC_BAD_INPUT);
Expand Down Expand Up @@ -152,6 +153,7 @@ export function buildDefaultExportPath(input: {
return path.join(input.downloadsPath, filename);
}

// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: existing complexity, see #118
export async function resolveExportSource(
req: ExportRequest,
deps: { db?: Database | null } = {},
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/src/main/image-generation-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ export function parseImageGenerationUpdate(raw: unknown): ImageGenerationUpdateI
return out;
}

// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: existing complexity, see #118
export async function updateImageGenerationSettings(
patch: ImageGenerationUpdateInput,
): Promise<ImageGenerationSettingsView> {
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/src/main/imports/claude-code-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ function validateAnthropicBaseUrl(value: string): string | null {
}
}

// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: existing complexity, see #118
export function parseClaudeCodeSettings(
json: string,
options: ParseClaudeCodeOptions = {},
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/src/main/imports/codex-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ function stringRecord(
return Object.keys(map).length > 0 ? map : null;
}

// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: existing complexity, see #118
function parseProviderBlock(
id: string,
rawBlock: unknown,
Expand Down
1 change: 1 addition & 0 deletions apps/desktop/src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ async function scheduleStartupUpdateCheck(): Promise<void> {
if (!IS_VITEST) {
registerWorkspaceScheme();

// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: existing complexity, see #118
void app.whenReady().then(async () => {
// Extracted so the outer try/catch AND post-init listeners (whose callbacks
// fire outside this block) can route failures through the same boot-fallback
Expand Down
Loading
Loading