Repository navigation
chore(lint): enforce import/no-duplicates on bot+shared (#1378) - #1379
Conversation
Add eslint-plugin-import and replace the core no-duplicate-imports rule (no autofixer) with import/no-duplicates (autofixable, type-aware) in the bot/shared ratchet block. Autofix consolidates 41 duplicate imports across 10 bot files; the rule is promoted to error as a regression guard. shared had no same-kind duplicates (its only hits were type/value separations the new rule correctly leaves intact). Behavior-identical: bot tsc + full bot suite (2530) and shared suite (818) green.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
Warning Review limit reached
More reviews will be available in 33 minutes and 46 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis PR adds ChangesImport organization and ESLint configuration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Failed to generate code suggestions for PR |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
No issues found across 13 files
Auto-approved: Lint rule migration (no-duplicate-imports to import/no-duplicates) with 41 autofixed import consolidations, a dev-dependency addition, and no logic changes. All tests pass.
Re-trigger cubic
eslint-plugin-import@2.32.0 peer-caps at eslint 9, but the repo runs eslint 10.4.0 — it resolved as invalid/extraneous and broke fresh npm installs (ERESOLVE) in the compressed-size and queueResolver CI jobs. Swap to the maintained fork eslint-plugin-import-x@4.16.2 (peer: eslint ^8.57 || ^9 || ^10) and rename the rule to import-x/no-duplicates. Add eslint-import-resolver-node to satisfy the plugin's peer dep.
c96c481
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
There was a problem hiding this comment.
0 issues found across 3 files (changes from recent commits).
Requires human review: The diff includes Prettier formatting changes that restructure function call parameters and conditionals across multiple bot files, not just pure import merges. While the stated goal is lint rule changes, the formatting changes could introduce subtle logic errors and need human review.
Re-trigger cubic
|
Size Change: 0 B Total Size: 435 kB ℹ️ View Unchanged
|
The duplicate-import autofix in 49ca5b4 surfaced an orphaned createSuccessEmbed import; seek.ts only uses createErrorEmbed.
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
There was a problem hiding this comment.
0 issues found across 1 file (changes from recent commits).
Auto-approved: Lint config and dependency changes: swap core no-duplicate-imports for autofixable import-x/no-duplicates rule plus ESLint plugin addition. All source changes are autofixed import consolidations with zero logic changes.
Re-trigger cubic
|



What
First cleanup slice of #1378. Adds
eslint-plugin-importand swaps the coreno-duplicate-importsrule (which has no autofixer) forimport/no-duplicates(autofixable + type-aware) in thepackages/{bot,shared}ratchet block ofeslint.config.js.warn→error: the inventory is cleaned, so it's now a regression guard, not a ratchet warning.sharedhad no genuine same-kind duplicates — its only core-rule hits wereimport type/value separations, whichimport/no-duplicatescorrectly leaves intact (safer than the core rule underverbatimModuleSyntax).This drops bot duplicate-import warnings 41→0 and shared 2→0 (under the type-aware rule). Remaining #1378 inventory (
no-unsafe-*,complexity,no-unused-vars) is staged separately per that issue.Verification (first-hand)
npm run lint --workspace=…exit 0).bottsc + full suite: 2530 passed;sharedsuite: 818 passed.Part of #1378.
@cubic-dev-ai please review.
Summary by cubic
Enforce type‑aware duplicate import linting in bot and shared by switching to
eslint-plugin-import-xandimport-x/no-duplicates. Autofixed 41 duplicate imports in bot, promoted the rule to error, fixed ESLint 10 install issues, and removed an unusedcreateSuccessEmbedimport inseek.ts(part of #1378).Refactors
no-duplicate-importswithimport-x/no-duplicatesineslint.config.jsforpackages/{bot,shared}; set to error.sharedtype/value splits stay.Dependencies
eslint-plugin-import-xandeslint-import-resolver-node(dev) to rootpackage.jsonfor ESLint 10 compatibility.Written for commit 79a28d8. Summary will update on new commits.
Summary by CodeRabbit
eslint-plugin-importdependency to enhance code quality checks.