Skip to content

Conversation

@allouis
Copy link
Contributor

@allouis allouis commented Jan 6, 2026

no-issue

Removed unused catch binding variables and added eslint-disable comments for require() imports that are needed for type compatibility.


Note

Focuses on lint cleanups across url-utils with no functional changes.

  • Remove unused catch binding variables in absolute-to-relative.ts, absolute-to-transform-ready.ts, relative-to-absolute.ts, and strip-subdirectory-from-path.ts
  • Add ESLint disable comments for require() imports in html-transform.ts, lexical-transform.ts, and markdown-transform.ts to satisfy TypeScript/ESLint rules

Written by Cursor Bugbot for commit e9ecff0. This will update automatically on new commits. Configure here.

no-issue

Removed unused catch binding variables and added eslint-disable
comments for require() imports that are needed for type compatibility.
@coderabbitai
Copy link

coderabbitai bot commented Jan 6, 2026

Walkthrough

This pull request modifies seven utility files in the url-utils package. Four files refactor catch clauses by removing unused error parameters (e.g., changing catch (e) to catch). Three files add ESLint disable comments to suppress the no-require-imports rule for CommonJS require statements. No functional behavior changes occur; all modifications are syntactic or linting-related.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fixed linting errors' is directly related to the changeset, which involves removing unused catch bindings and adding ESLint disable comments across multiple files.
Description check ✅ Passed The description clearly explains the changes made: removing unused catch variables and adding ESLint disable comments for require() imports, matching the actual modifications in the changeset.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6680b67 and e9ecff0.

📒 Files selected for processing (7)
  • packages/url-utils/src/utils/absolute-to-relative.ts
  • packages/url-utils/src/utils/absolute-to-transform-ready.ts
  • packages/url-utils/src/utils/html-transform.ts
  • packages/url-utils/src/utils/lexical-transform.ts
  • packages/url-utils/src/utils/markdown-transform.ts
  • packages/url-utils/src/utils/relative-to-absolute.ts
  • packages/url-utils/src/utils/strip-subdirectory-from-path.ts
🧰 Additional context used
🧬 Code graph analysis (1)
packages/url-utils/src/utils/markdown-transform.ts (4)
packages/url-utils/test/unit/utils/markdown-absolute-to-relative.test.js (1)
  • remark (10-10)
packages/url-utils/test/unit/utils/markdown-relative-to-absolute.test.js (1)
  • remark (10-10)
packages/url-utils/test/unit/utils/markdown-relative-to-transform-ready.test.js (1)
  • remark (10-10)
packages/url-utils/test/unit/utils/markdown-absolute-to-transform-ready.test.js (1)
  • remark (10-10)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Cursor Bugbot
🔇 Additional comments (8)
packages/url-utils/src/utils/relative-to-absolute.ts (1)

76-78: LGTM! Clean linting fix.

Removing the unused error parameter from the catch clause is correct and improves code cleanliness.

packages/url-utils/src/utils/lexical-transform.ts (1)

2-3: LGTM! Appropriate ESLint suppression.

The single-line eslint-disable comment is appropriately scoped for the CommonJS require statement.

packages/url-utils/src/utils/absolute-to-relative.ts (1)

50-52: LGTM! Clean linting fix.

Removing the unused error parameter from the catch clause is correct and consistent with the other files in this PR.

packages/url-utils/src/utils/absolute-to-transform-ready.ts (1)

20-23: LGTM! Clean linting fix.

Removing the unused error parameter from the catch clause is correct and maintains the same error handling behavior.

packages/url-utils/src/utils/strip-subdirectory-from-path.ts (1)

20-22: LGTM! Clean linting fix.

Removing the unused error parameter from the catch clause is correct and completes the consistent linting cleanup across all URL utility files in this PR.

packages/url-utils/src/utils/markdown-transform.ts (2)

45-46: Targeted suppression for lazy-loaded require is appropriate.

The inline eslint-disable comment correctly suppresses the rule for the conditional require of remark. The lazy-loading pattern defers the expensive remark import until needed. Since remark 11.0.2 is CommonJS-based (ES modules were introduced only in later major versions), the require() approach is the correct choice here. Dynamic import() would not provide benefits and would require making the function async, which would be a breaking API change.


2-6: Block suppression appropriately wraps static CommonJS requires.

The eslint-disable/enable block correctly suppresses the rule for the CommonJS requires of remark-footnotes and unist-util-visit. These library versions (1.0.0 and 2.0.0 respectively) are CommonJS-only and do not support ES module imports, making the require() syntax necessary rather than optional.

packages/url-utils/src/utils/html-transform.ts (1)

2-3: ESLint suppression is appropriate for this cheerio version.

The CommonJS require is necessary because the project uses cheerio ^0.22.0, which is CJS-only. ES module support was added in later major versions (1.0+). The targeted ESLint disable comment correctly suppresses the rule for this required dependency.


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 and usage tips.

@allouis allouis merged commit 8954dfc into main Jan 6, 2026
4 checks passed
@allouis allouis deleted the fix-linting branch January 6, 2026 10:55
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