Skip to content

fix(lint): resolve all 19 ESLint errors across 9 files - #588

Merged
phodal merged 1 commit into
phodal:mainfrom
im47cn:fix/eslint-errors
Jul 29, 2026
Merged

fix(lint): resolve all 19 ESLint errors across 9 files#588
phodal merged 1 commit into
phodal:mainfrom
im47cn:fix/eslint-errors

Conversation

@im47cn

@im47cn im47cn commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

npm run lint was reporting 19 errors across 9 files. This PR resolves all of them.

Changes by category

Rule Files Fix
react-hooks/exhaustive-deps cursor-canvas-runtime.tsx, presentation-preview.tsx Wrap derived values in useMemo
react-hooks/set-state-in-effect cursor-canvas-runtime.tsx (×2) Derive during render or suppress with justification
@next/next/no-img-element cursor-canvas-runtime.tsx Suppress for office-render thumbnails (not Next.js route images)
preserve-caught-error cursor-canvas.ts, specialist-review.ts Attach { cause } when rethrowing
no-useless-assignment office-color-utils.ts, analyze-search-tool-usage.ts Convert let + reassign to const expression
no-useless-escape framework-feature-tree-generator.ts Remove unnecessary \[ inside character classes
@typescript-eslint/no-unused-vars feature-tree-generator.ts, analyze-search-tool-usage.ts Prefix with _
prefer-const mcp-http-proxy.mjs Suppress (intentionally uninitialized until connect)
no-undef mcp-http-proxy.mjs Use globalThis.URL for Node.js ESM

Test plan

  • npm run lint → 0 errors
  • npx tsc --noEmit → passes
  • Affected tests pass (agent-install-panel, specialist-review)

Summary by CodeRabbit

  • Bug Fixes
    • Improved presentation preview stability when switching slides.
    • Prevented unnecessary updates while loading presentation thumbnails and canvas images.
    • Improved speaker-notes visibility and toggle-state consistency.
    • Enhanced color saturation handling for more reliable presentation styling.
    • Added clearer diagnostic details when presentation rendering or review services fail.
    • Improved detection of documented framework routes and reliability of supporting tools.

Fixes:
- react-hooks/exhaustive-deps: wrap derived values in useMemo
- react-hooks/set-state-in-effect: derive during render or suppress
  with justification for legitimate sync patterns
- @next/next/no-img-element: suppress for office-render thumbnails
- prefer-const / no-useless-assignment: clean up mutable bindings
- preserve-caught-error: attach cause when rethrowing
- no-useless-escape: remove unnecessary backslashes in regex
- no-undef: use globalThis.URL for Node.js ESM globals
- @typescript-eslint/no-unused-vars: prefix unused declarations

Co-authored-by: Crush (GLM 5.2) <crush@local>
@im47cn
im47cn requested a review from phodal as a code owner July 29, 2026 06:40
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: efa686f8-b5f3-4d7d-9a4e-5ec768ce76ea

📥 Commits

Reviewing files that changed from the base of the PR and between 9c880e7 and 998a3a9.

📒 Files selected for processing (9)
  • packages/office-render/src/presentation/cursor-canvas-runtime.tsx
  • packages/office-render/src/presentation/presentation-preview.tsx
  • packages/office-render/src/shared/office-color-utils.ts
  • packages/office/src/cursor-canvas.ts
  • scripts/docs/feature-tree-generator.ts
  • scripts/docs/framework-feature-tree-generator.ts
  • scripts/harness/analyze-search-tool-usage.ts
  • scripts/mcp-http-proxy.mjs
  • tools/hook-runtime/src/specialist-review.ts

📝 Walkthrough

Walkthrough

Presentation selection and speaker-notes state handling are updated alongside error-cause preservation, tooling adjustments, MCP transport initialization changes, and a refactor of hue normalization logic.

Changes

Maintenance updates

Layer / File(s) Summary
Presentation state and rendering
packages/office-render/src/presentation/*
Selected slides are memoized, redundant index updates are avoided, cancelled image loading no longer updates state, and speaker-notes visibility uses one consolidated flag.
Error cause preservation
packages/office/src/cursor-canvas.ts, tools/hook-runtime/src/specialist-review.ts
Missing-runtime and fallback-validation errors retain their original errors as causes.
Documentation and analysis tooling
scripts/docs/*, scripts/harness/*
Internal identifiers and initialization are adjusted, unused return-value storage is removed, and Spring route matching is updated.
MCP transport initialization
scripts/mcp-http-proxy.mjs
Deferred transport initialization and explicit global URL construction are applied.
Color hue calculation
packages/office-render/src/shared/office-color-utils.ts
Hue normalization is rewritten as an inline conditional expression.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • phodal/routa#461: Introduced the MCP bridge script that this change further updates.

Suggested reviewers: phodal

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: fixing 19 ESLint errors across 9 files.
Description check ✅ Passed The description covers the summary, categorized changes, and validation results, with only the Notes section left incomplete.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@phodal
phodal merged commit 9428e28 into phodal:main Jul 29, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants