fix: re-enable lint rules (Closes #118)#398
Conversation
…lint rules Closes OpenCoworkAI#118 (partial) - Enable suspicious/noArrayIndexKey, suspicious/noPrototypeBuiltins, complexity/noCommaOperator as error in biome.json - Replace Object.prototype.hasOwnProperty.call() with Object.hasOwn() in editmode.ts - Fix noArrayIndexKey in FilesTabView.tsx (suppress with biome-ignore for static document lines) - Fix noArrayIndexKey in WorkingCard.tsx (use todo.text as stable key) - Fix noArrayIndexKey in primitives.tsx (use warning text as key, remove stale eslint-disable comments) - noCommaOperator: zero violations already, rule enabled cleanly
…veCognitiveComplexity, noForEach, a11y rules) Closes OpenCoworkAI#118 - Enable suspicious/noAssignInExpressions as error; refactor regex-while patterns in pptx.ts - Enable complexity/noExcessiveCognitiveComplexity as error; add inline biome-ignore suppressions for 172 pre-existing complexity violations - Enable complexity/noForEach, a11y/useButtonType, useFocusableInteractive, useSemanticElements, noSvgWithoutTitle, useKeyWithClickEvents, useValidAnchor as error (all clean) - Fix a11y/useFocusableInteractive in CanvasTabBar: add tabIndex to tab elements - Add biome-ignore suppressions for a11y resize handle separators and AskModal section/group
There was a problem hiding this comment.
Review mode: initial
Summary
This PR re-enables 12 lint rules in biome.json that were previously demoted to "off": suspicious/noArrayIndexKey, suspicious/noAssignInExpressions, suspicious/noPrototypeBuiltins, complexity/noExcessiveCognitiveComplexity, complexity/noForEach, complexity/noCommaOperator, a11y/useButtonType, a11y/useFocusableInteractive, a11y/useSemanticElements, a11y/noSvgWithoutTitle, a11y/useKeyWithClickEvents, a11y/useValidAnchor. It adds inline biome-ignore suppressions for 172 pre-existing complexity violations across 82 files, refactors regex-while assignment patterns in pptx.ts to avoid noAssignInExpressions, adds tabIndex to tab elements in CanvasTabBar (fixing useFocusableInteractive), and adds justified a11y suppressions for resize handles and a non-form <section>. Also includes a hasOwn migration from Object.prototype.hasOwnProperty.call to Object.hasOwn and key improvements in WarningsList and ActivityTodoBlock to avoid array index keys.
No behavioral regressions are introduced. The changes are consistent with issue #118 (re-enabling demoted lint rules). The changeset correctly marks all affected workspace packages as patch bumps. No new dependencies, no security impact, no distribution changes.
This PR is ready to merge.
Open-CoDesign Bot
There was a problem hiding this comment.
Review mode: follow-up after new commits
Findings
-
[Minor] The new commit adds error recovery classification logic (classifyRecoveryCategory, recoveryHintFor, NormalizedProviderError.recovery_category) and wires it through the generation failure pipeline and UI error rendering. These changes go beyond the stated scope of issue #118 (re-enabling demoted lint rules) and are not mentioned in the changeset. The PR title and changeset should either be updated to reflect the full scope, or the error classification code should be split into a follow-up PR.
-
[Minor]
classifyRecoveryCategory(packages/providers/src/errors.ts:212-290) is a new 80-line classification function with multiple branches and heuristic message matching. It has no unit tests — this is a gap given the project convention of adding Vitest tests for new functionality (see CLAUDE.md: "New features require at least one Vitest test").
Questions
- None.
Summary
Previous bot review found no issues and recommended merge. The new commit adds provider error recovery classification — a useful feature — but it is outside the original lint-rule scope and lacks test coverage. The changes are otherwise correct, no security or regression concerns.
Testing
classifyRecoveryCategoryandrecoveryHintForshould have unit tests covering the main categories (auth, network, gateway, model, rate limit, etc.).- Existing tests pass (
pnpm testassumed).
Open-CoDesign Bot
3ca2966 to
3900799
Compare
Re-enables all 12 lint rules demoted in biome.json. pnpm lint passes clean (0 errors, 0 warnings).