Skip to content

Conversation

@Alexander-Turkin
Copy link
Contributor

@Alexander-Turkin Alexander-Turkin commented Jan 22, 2026

Summary by CodeRabbit

  • Chores
    • Updated ESLint rules to discourage barrel/named lodash imports and suggest granular subpath imports.
  • Refactor
    • Rewrote lodash imports across the codebase (~50 files) to use individual subpath/module imports (preserving behavior) to improve module resolution and enable better tree-shaking.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 22, 2026

📝 Walkthrough

Walkthrough

Adds ESLint restrictions preventing named lodash barrel imports (including require/destructuring patterns) and converts existing named lodash imports across the codebase to explicit subpath imports (e.g., lodash/get), preserving runtime behavior.

Changes

Cohort / File(s) Summary
ESLint Configuration
./.eslintrc.js
Broaden no-restricted-syntax to block ImportDeclaration[source.value="lodash"] and add a new rule disallowing destructuring-from-require("lodash"), with messages recommending specific subpath imports (e.g., lodash/get).
Acquiring
apps/condo/domains/acquiring/components/payments/PaymentsTable.tsx, apps/condo/domains/acquiring/utils/clientSchema/search.ts
Replace named lodash imports with subpath imports (lodash/get, lodash/isEmpty).
Analytics
apps/condo/domains/analytics/utils/helpers.ts
Replace isEmpty named import with lodash/isEmpty.
Common — Components
apps/condo/domains/common/components/BaseSearchInput/index.tsx, apps/condo/domains/common/components/Comments/index.tsx, apps/condo/domains/common/components/TextHighlighter.tsx
Convert isEmpty, pickBy, isNull to subpath imports.
Common — Containers & Hooks
apps/condo/domains/common/components/containers/FormList.tsx, apps/condo/domains/common/hooks/useDateRangeSearch.ts, apps/condo/domains/common/hooks/useExportToExcel.tsx, apps/condo/domains/common/hooks/useGlobalHints.tsx
Convert various lodash utilities (isUndefined, throttle, debounce, get, isArray, isObject) to subpath imports.
Contact
apps/condo/domains/contact/components/ContactsEditor/index.tsx, .../contactRoles/BaseContactRoleForm.tsx, .../contactRoles/CreateContactRoleForm.tsx, .../contactRoles/UpdateContactRoleForm.tsx
Convert isNil and get to lodash/isNil and lodash/get.
Marketplace
apps/condo/domains/marketplace/components/Invoice/InvoiceForm.tsx, apps/condo/domains/marketplace/utils/clientSchema/Invoice.ts
Convert get, isNull, isUndefined, pickBy to subpath imports.
Meter
apps/condo/domains/meter/components/Import/Index.tsx, apps/condo/domains/meter/utils/helpers.ts
Convert isFunction, isNil, isUndefined to subpath imports.
Organization
apps/condo/domains/organization/components/EmployeeForm/UpdateEmployeeForm.tsx, apps/condo/domains/organization/utils/clientSchema/OrganizationEmployee.ts, apps/condo/domains/organization/utils/clientSchema/Renders.tsx
Convert difference, find, get, omit, isEmpty to subpath imports.
Property
apps/condo/domains/property/components/UnitInfo.tsx, apps/condo/domains/property/components/panels/Builder/MapConstructor.spec.ts, apps/condo/domains/property/utils/clientSchema/Property.ts
Convert isEmpty, cloneDeep, get to subpath imports.
Scope — Components
apps/condo/domains/scope/components/BasePropertyScopeForm.tsx, .../CreatePropertyScopeForm.tsx, .../UpdatePropertyScopeForm.tsx
Convert difference, isEmpty, get to subpath imports.
Scope — Utils
apps/condo/domains/scope/utils/clientSchema/search.ts, apps/condo/domains/scope/utils/clientSchema/utils.tsx
Convert isEmpty, differenceBy, get to subpath imports.
Ticket — Card & Classifier
apps/condo/domains/ticket/components/ClientCard/TabContent.tsx, apps/condo/domains/ticket/components/TicketClassifierSelect.tsx
Convert isNil, uniqBy, isEmpty, find, pick to subpath imports.
Ticket — TicketId
apps/condo/domains/ticket/components/TicketId/TicketClientField.tsx, .../TicketFileListField.tsx
Convert get, isEmpty to subpath imports.
Ticket — PropertyHint
apps/condo/domains/ticket/components/TicketPropertyHint/*.tsx
Convert get, isEmpty to subpath imports across Base/Create/Settings/Card/Update components.
Ticket — Utils
apps/condo/domains/ticket/utils/clientSchema/IncidentRenders.tsx, .../Ticket.ts, .../clientCard.tsx
Convert isEmpty, get, isUndefined, isNull to subpath imports.
User
apps/condo/domains/user/components/SectionNameInput.tsx
Convert sortBy to lodash/sortBy.
Pages
apps/condo/pages/employee/[id]/index.tsx, apps/condo/pages/employee/index.tsx, apps/condo/pages/news/index.tsx, apps/condo/pages/property/[id]/hint.tsx
Convert map, get, isEmpty to subpath imports.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰
I hopped through imports, neat and quick,
Swapping barrels for paths, every trick.
lodash/get and friends in a row,
Tiny changes — the codebase aglow! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately describes the main changes: refactoring lodash imports to use specific module paths and adding an ESLint rule to enforce this pattern across the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

Copy link
Contributor

@tolmachev21 tolmachev21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!!

@sonarqubecloud
Copy link

@Alexander-Turkin Alexander-Turkin merged commit 5fbe7cd into main Jan 27, 2026
38 checks passed
@Alexander-Turkin Alexander-Turkin deleted the fix/condo/fix-lodash-imports branch January 27, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants