Skip to content

chore(eslint): Replace eslint-plugin-import with eslint-plugin-import-x - #41401

Merged
ggazzo merged 2 commits into
developfrom
chore/eslint-import-x
Jul 16, 2026
Merged

chore(eslint): Replace eslint-plugin-import with eslint-plugin-import-x#41401
ggazzo merged 2 commits into
developfrom
chore/eslint-import-x

Conversation

@tassoevan

@tassoevan tassoevan commented Jul 15, 2026

Copy link
Copy Markdown
Member

Proposed changes (including videos or screenshots)

Replaces eslint-plugin-import (~2.32.0) with its actively maintained fork eslint-plugin-import-x (~4.17.1) across the monorepo, keeping the effective rule set identical.

@rocket.chat/eslint-config

  • All import/* rules and settings renamed to import-x/* with the same severities and options, including the overrides in the root eslint.config.mjs and every inline disable directive.
  • Module resolution now uses the modern import-x/resolver-next API with an explicit chain: a node resolver first (with exportsFields: [] to keep the old eslint-import-resolver-node behavior of ignoring package exports maps — required for deep imports like csv-parse/lib/sync and swiper/modules/*.css), then the TypeScript resolver. The order matters: the TS resolver alone would resolve packages like node-fetch to their @types/* declarations and produce false import-x/named errors.
  • Dropped the now-dead eslint-plugin-import/minimatch yarn resolution (import-x already uses minimatch 9/10).

Unused directive cleanup

  • With reportUnusedDisableDirectives already enabled, wiped all stale eslint-disable directives repo-wide via eslint --fix --fix-type directive, run per workspace so resolution context matches how turbo lints (notably meteor/* imports only resolve from within apps/meteor). 42 files touched, removals only — no behavioral autofixes were applied.

Rule parity was verified by diffing eslint --print-config output before/after, and by injecting deliberate violations (import order, duplicated imports, statement-before-import, missing group separation) in files across apps/meteor, packages/*, ee/packages/*, and ee/apps/* — every one was reported as an import-x/* error.

No changeset: developer tooling only, no end-user impact.

Issue(s)

Steps to test or reproduce

  • Run yarn lint — all 71 tasks pass with no errors and no unused-directive warnings.
  • Scramble any import block (reorder, duplicate, remove group blank line) in any workspace and run that workspace's yarn lint — the violation is reported as an import-x/* error.

Further comments

eslint-plugin-import has slow release cadence and lacks first-class flat-config/ESLint 9 support; import-x is the community fork adopted by most of the ecosystem, with the same rule implementations and active maintenance. The resolver configuration is the only place where behavior could have drifted, hence the explicit node-first chain documented inline in packages/eslint-config/index.js.

🤖 Generated with Claude Code

Review in cubic

Summary by CodeRabbit

  • Chores

    • Updated code-quality configuration and linting rules for more consistent import validation.
    • Removed outdated lint exceptions across application, server, and shared code.
    • Simplified select lint-related code patterns without changing runtime behavior.
  • Tests

    • Cleaned up lint directives in automated test files while preserving existing test coverage and assertions.
  • Impact

    • No user-facing features, workflows, or application behavior changed.

Task: ARCH-2256

@tassoevan
tassoevan requested review from a team as code owners July 15, 2026 18:41
@dionisio-bot

dionisio-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Looks like this PR is ready to merge! 🎉
If you have any trouble, please check the PR guidelines

@changeset-bot

changeset-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0d4185b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The pull request migrates ESLint import rules from eslint-plugin-import to eslint-plugin-import-x, updates related suppressions, removes redundant lint directives across the codebase, and makes small equivalent simplifications in memoization and component comparison code.

Changes

ESLint import migration

Layer / File(s) Summary
Import plugin and rule migration
eslint.config.mjs, packages/eslint-config/*, package.json, apps/meteor/client/meteor/login/*, apps/meteor/server/api/ApiClass.ts, apps/meteor/server/lib/i18n.ts, ee/apps/omnichannel-transcript/src/i18n.ts, packages/apps/node-runtime/src/lib/require.ts, apps/meteor/.scripts/version.js, apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts, apps/meteor/server/services/import/service.spec.ts
Import rules, resolvers, dependencies, and matching suppression comments now use import-x equivalents.

Client and package cleanup

Layer / File(s) Summary
Client, declarations, packages, and tests
apps/meteor/app/utils/*, apps/meteor/client/*, packages/cas-validate/*, packages/mock-providers/*, packages/ui-client/*, ee/packages/license/*
Redundant naming-convention, explicit-return-type, and test-file suppressions are removed without changing signatures, assertions, or implementations.

Server cleanup

Layer / File(s) Summary
Server and enterprise suppression cleanup
apps/meteor/ee/server/*, apps/meteor/server/*, apps/meteor/tests/*
Redundant suppressions are removed from cron, API, upload, settings, storage, utility, bridge, service, and test code while existing logic remains unchanged.

Implementation simplifications

Layer / File(s) Summary
Memoization and component comparison cleanup
apps/meteor/ee/server/lib/omnichannel/debounceByParams.ts, apps/meteor/client/views/navigation/sidebar/RoomList/SidebarItemWithData.tsx
The memoized debounce factory is condensed, and the sidebar comparator checks selected prop keys before deeper room comparisons.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: type: chore

Suggested reviewers: sampaiodiego

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.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
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: migrating from eslint-plugin-import to eslint-plugin-import-x.

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.

@tassoevan
tassoevan force-pushed the chore/eslint-import-x branch from d798571 to f387ed3 Compare July 15, 2026 18:43
@tassoevan
tassoevan requested a review from a team as a code owner July 15, 2026 18:43
@tassoevan tassoevan changed the title chore: replace eslint-plugin-import with eslint-plugin-import-x chore(eslint): replace eslint-plugin-import with eslint-plugin-import-x Jul 15, 2026
@tassoevan tassoevan changed the title chore(eslint): replace eslint-plugin-import with eslint-plugin-import-x chore(eslint): Eeplace eslint-plugin-import with eslint-plugin-import-x Jul 15, 2026
@tassoevan tassoevan changed the title chore(eslint): Eeplace eslint-plugin-import with eslint-plugin-import-x chore(eslint): Replace eslint-plugin-import with eslint-plugin-import-x Jul 15, 2026
@tassoevan tassoevan added this to the 8.7.0 milestone Jul 15, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/meteor/.scripts/run-ha.ts`:
- Around line 59-60: Restore an unused-vars suppression for the customEnv and
parentEnv destructuring in the run-ha configuration setup, preferably using the
existing local suppression pattern; alternatively add a scoped exemption for
run-ha.ts so `@typescript-eslint/no-unused-vars` does not flag these intentionally
discarded properties.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2fe2d8e0-af2f-4d4c-af29-3c1cde2f4252

📥 Commits

Reviewing files that changed from the base of the PR and between 0e7b205 and f387ed3.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (54)
  • apps/meteor/.scripts/run-ha.ts
  • apps/meteor/.scripts/version.js
  • apps/meteor/app/utils/client/getURL.ts
  • apps/meteor/app/utils/lib/getURL.ts
  • apps/meteor/client/components/GenericUpsellModal/GenericUpsellModal.spec.tsx
  • apps/meteor/client/definitions/global.d.ts
  • apps/meteor/client/meteor/login/facebook.ts
  • apps/meteor/client/meteor/login/google.ts
  • apps/meteor/client/meteor/login/meteorDeveloperAccount.ts
  • apps/meteor/client/meteor/login/twitter.ts
  • apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsx
  • apps/meteor/client/views/admin/engagementDashboard/channels/useChannelsList.ts
  • apps/meteor/client/views/admin/engagementDashboard/messages/useMessageOrigins.ts
  • apps/meteor/client/views/admin/engagementDashboard/messages/useMessagesSent.ts
  • apps/meteor/client/views/admin/engagementDashboard/messages/useTopFivePopularChannels.ts
  • apps/meteor/client/views/admin/engagementDashboard/users/useActiveUsers.ts
  • apps/meteor/client/views/admin/engagementDashboard/users/useUsersByTimeOfTheDay.ts
  • apps/meteor/client/views/e2e/EnterE2EPasswordModal/EnterE2EPasswordModal.spec.tsx
  • apps/meteor/client/views/navigation/sidebar/RoomList/SidebarItemWithData.tsx
  • apps/meteor/client/views/omnichannel/components/outboundMessage/components/OutboundMessageWizard/steps/MessageStep.spec.tsx
  • apps/meteor/client/views/omnichannel/components/outboundMessage/components/OutboundMessageWizard/steps/RecipientStep.spec.tsx
  • apps/meteor/client/views/omnichannel/components/outboundMessage/components/OutboundMessageWizard/steps/RepliesStep.spec.tsx
  • apps/meteor/ee/server/cron/readReceiptsArchive.ts
  • apps/meteor/ee/server/lib/omnichannel/debounceByParams.ts
  • apps/meteor/server/api/ApiClass.ts
  • apps/meteor/server/api/lib/isValidQuery.ts
  • apps/meteor/server/bridges/slack/slackbridge.ts
  • apps/meteor/server/lib/error-handler/RocketChat.ErrorHandler.ts
  • apps/meteor/server/lib/i18n.ts
  • apps/meteor/server/lib/media/file-upload/lib/FileUpload.ts
  • apps/meteor/server/lib/messages/isTheLastMessage.ts
  • apps/meteor/server/lib/rooms/updateGroupDMsName.ts
  • apps/meteor/server/lib/utils/getURL.ts
  • apps/meteor/server/services/import/service.spec.ts
  • apps/meteor/server/services/omnichannel-analytics/service.ts
  • apps/meteor/server/settings/SettingsRegistry.ts
  • apps/meteor/server/settings/functions/settings.mocks.ts
  • apps/meteor/server/settings/startup.ts
  • apps/meteor/server/ufs/ufs-server.ts
  • apps/meteor/server/ufs/ufs-store.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/page-objects/login.ts
  • apps/meteor/tests/unit/server/services/omnichannel-analytics/AgentData.tests.ts
  • ee/apps/omnichannel-transcript/src/i18n.ts
  • ee/packages/license/src/licenseImp.ts
  • eslint.config.mjs
  • package.json
  • packages/apps/node-runtime/src/lib/require.ts
  • packages/cas-validate/src/validate.ts
  • packages/ddp-client/src/types/methods.ts
  • packages/eslint-config/index.js
  • packages/eslint-config/package.json
  • packages/mock-providers/src/MockedAppRootBuilder.tsx
  • packages/ui-client/src/methods.d.ts
💤 Files with no reviewable changes (28)
  • apps/meteor/server/lib/messages/isTheLastMessage.ts
  • apps/meteor/client/views/omnichannel/components/outboundMessage/components/OutboundMessageWizard/steps/MessageStep.spec.tsx
  • apps/meteor/server/services/omnichannel-analytics/service.ts
  • apps/meteor/client/views/admin/engagementDashboard/users/useUsersByTimeOfTheDay.ts
  • apps/meteor/client/components/GenericUpsellModal/GenericUpsellModal.spec.tsx
  • apps/meteor/client/views/admin/engagementDashboard/messages/useTopFivePopularChannels.ts
  • packages/ui-client/src/methods.d.ts
  • apps/meteor/client/views/admin/engagementDashboard/messages/useMessagesSent.ts
  • apps/meteor/server/api/lib/isValidQuery.ts
  • apps/meteor/server/settings/SettingsRegistry.ts
  • apps/meteor/server/settings/startup.ts
  • apps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsx
  • apps/meteor/client/definitions/global.d.ts
  • apps/meteor/client/views/admin/engagementDashboard/users/useActiveUsers.ts
  • apps/meteor/server/lib/error-handler/RocketChat.ErrorHandler.ts
  • apps/meteor/client/views/admin/engagementDashboard/channels/useChannelsList.ts
  • packages/ddp-client/src/types/methods.ts
  • packages/mock-providers/src/MockedAppRootBuilder.tsx
  • apps/meteor/client/views/omnichannel/components/outboundMessage/components/OutboundMessageWizard/steps/RecipientStep.spec.tsx
  • apps/meteor/server/lib/rooms/updateGroupDMsName.ts
  • apps/meteor/server/ufs/ufs-store.ts
  • package.json
  • apps/meteor/client/views/navigation/sidebar/RoomList/SidebarItemWithData.tsx
  • apps/meteor/client/views/e2e/EnterE2EPasswordModal/EnterE2EPasswordModal.spec.tsx
  • apps/meteor/client/views/admin/engagementDashboard/messages/useMessageOrigins.ts
  • apps/meteor/client/views/omnichannel/components/outboundMessage/components/OutboundMessageWizard/steps/RepliesStep.spec.tsx
  • apps/meteor/server/ufs/ufs-server.ts
  • ee/packages/license/src/licenseImp.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (3)
  • GitHub Check: CodeQL-Build
  • GitHub Check: Hacktron Security Check
  • GitHub Check: CodeQL-Build
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • packages/apps/node-runtime/src/lib/require.ts
  • apps/meteor/server/services/import/service.spec.ts
  • apps/meteor/server/lib/utils/getURL.ts
  • ee/apps/omnichannel-transcript/src/i18n.ts
  • apps/meteor/server/lib/i18n.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/client/meteor/login/facebook.ts
  • apps/meteor/client/meteor/login/google.ts
  • apps/meteor/tests/unit/server/services/omnichannel-analytics/AgentData.tests.ts
  • apps/meteor/server/api/ApiClass.ts
  • apps/meteor/app/utils/lib/getURL.ts
  • apps/meteor/tests/e2e/page-objects/login.ts
  • apps/meteor/ee/server/lib/omnichannel/debounceByParams.ts
  • apps/meteor/server/bridges/slack/slackbridge.ts
  • apps/meteor/client/meteor/login/twitter.ts
  • apps/meteor/client/meteor/login/meteorDeveloperAccount.ts
  • packages/eslint-config/index.js
  • apps/meteor/server/lib/media/file-upload/lib/FileUpload.ts
  • packages/cas-validate/src/validate.ts
  • apps/meteor/server/settings/functions/settings.mocks.ts
  • apps/meteor/app/utils/client/getURL.ts
  • apps/meteor/ee/server/cron/readReceiptsArchive.ts
**/*.spec.ts

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.spec.ts: Use descriptive test names that clearly communicate expected behavior in Playwright tests
Use .spec.ts extension for test files (e.g., login.spec.ts)

Files:

  • apps/meteor/server/services/import/service.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
apps/meteor/tests/e2e/**/*.spec.ts

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

apps/meteor/tests/e2e/**/*.spec.ts: All test files must be created in apps/meteor/tests/e2e/ directory
Avoid using page.locator() in Playwright tests - always prefer semantic locators such as page.getByRole(), page.getByLabel(), page.getByText(), or page.getByTitle()
Use test.beforeAll() and test.afterAll() for setup/teardown in Playwright tests
Use test.step() for complex test scenarios to improve organization in Playwright tests
Group related tests in the same file
Utilize Playwright fixtures (test, page, expect) for consistency in test files
Prefer web-first assertions (toBeVisible, toHaveText, etc.) in Playwright tests
Use expect matchers for assertions (toEqual, toContain, toBeTruthy, toHaveLength, etc.) instead of assert statements in Playwright tests
Use page.waitFor() with specific conditions instead of hardcoded timeouts in Playwright tests
Implement proper wait strategies for dynamic content in Playwright tests
Maintain test isolation between test cases in Playwright tests
Ensure clean state for each test execution in Playwright tests
Ensure tests run reliably in parallel without shared state conflicts

Files:

  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
apps/meteor/tests/e2e/**/*.{ts,spec.ts}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

apps/meteor/tests/e2e/**/*.{ts,spec.ts}: Store commonly used locators in variables/constants for reuse
Follow Page Object Model pattern consistently in Playwright tests

Files:

  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/page-objects/login.ts
apps/meteor/tests/e2e/page-objects/**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

Utilize existing page objects pattern from apps/meteor/tests/e2e/page-objects/

Files:

  • apps/meteor/tests/e2e/page-objects/login.ts
🧠 Learnings (12)
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In the Rocket.Chat repository, do not reference Biome lint rules in code review feedback. Biome is not used even if biome.json exists; only reference Biome rules if there is explicit, project-wide usage documented. For TypeScript files, review lint implications without Biome guidance unless the project enables Biome rules.

Applied to files:

  • packages/apps/node-runtime/src/lib/require.ts
  • apps/meteor/server/services/import/service.spec.ts
  • apps/meteor/server/lib/utils/getURL.ts
  • ee/apps/omnichannel-transcript/src/i18n.ts
  • apps/meteor/server/lib/i18n.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/client/meteor/login/facebook.ts
  • apps/meteor/client/meteor/login/google.ts
  • apps/meteor/tests/unit/server/services/omnichannel-analytics/AgentData.tests.ts
  • apps/meteor/server/api/ApiClass.ts
  • apps/meteor/app/utils/lib/getURL.ts
  • apps/meteor/tests/e2e/page-objects/login.ts
  • apps/meteor/ee/server/lib/omnichannel/debounceByParams.ts
  • apps/meteor/server/bridges/slack/slackbridge.ts
  • apps/meteor/client/meteor/login/twitter.ts
  • apps/meteor/client/meteor/login/meteorDeveloperAccount.ts
  • apps/meteor/server/lib/media/file-upload/lib/FileUpload.ts
  • packages/cas-validate/src/validate.ts
  • apps/meteor/server/settings/functions/settings.mocks.ts
  • apps/meteor/app/utils/client/getURL.ts
  • apps/meteor/ee/server/cron/readReceiptsArchive.ts
📚 Learning: 2026-02-26T19:25:44.063Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 38778
File: packages/ui-voip/src/providers/useMediaSession.ts:192-192
Timestamp: 2026-02-26T19:25:44.063Z
Learning: In this repository (RocketChat/Rocket.Chat), Biome lint rules are not used even if a biome.json exists. When reviewing TypeScript files (e.g., packages/ui-voip/src/providers/useMediaSession.ts), ensure lint suggestions do not reference Biome-specific rules. Rely on general ESLint/TypeScript lint rules and project conventions instead.

Applied to files:

  • packages/apps/node-runtime/src/lib/require.ts
  • apps/meteor/server/services/import/service.spec.ts
  • apps/meteor/server/lib/utils/getURL.ts
  • ee/apps/omnichannel-transcript/src/i18n.ts
  • apps/meteor/server/lib/i18n.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/client/meteor/login/facebook.ts
  • apps/meteor/client/meteor/login/google.ts
  • apps/meteor/tests/unit/server/services/omnichannel-analytics/AgentData.tests.ts
  • apps/meteor/server/api/ApiClass.ts
  • apps/meteor/app/utils/lib/getURL.ts
  • apps/meteor/tests/e2e/page-objects/login.ts
  • apps/meteor/ee/server/lib/omnichannel/debounceByParams.ts
  • apps/meteor/server/bridges/slack/slackbridge.ts
  • apps/meteor/client/meteor/login/twitter.ts
  • apps/meteor/client/meteor/login/meteorDeveloperAccount.ts
  • apps/meteor/server/lib/media/file-upload/lib/FileUpload.ts
  • packages/cas-validate/src/validate.ts
  • apps/meteor/server/settings/functions/settings.mocks.ts
  • apps/meteor/app/utils/client/getURL.ts
  • apps/meteor/ee/server/cron/readReceiptsArchive.ts
📚 Learning: 2026-05-06T12:21:44.083Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 40256
File: apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx:121-149
Timestamp: 2026-05-06T12:21:44.083Z
Learning: Field wrappers in rocket.chat/fuselage-forms (Field, FieldLabel, FieldRow, FieldError, FieldHint) auto-create htmlFor/id associations, aria-describedby, and role="alert" for errors. Do not manually set htmlFor, id, aria-describedby, or role attributes when using these wrappers. This automatic wiring does not apply to plain rocket.chat/fuselage components, which require explicit ID wiring per the accessibility docs. In code reviews, prefer using fuselage-forms wrappers for form fields and verify there is no unnecessary manual ID/aria wiring in files that use these wrappers. If a component uses plain fuselage components, ensure proper id wiring as per docs.

Applied to files:

  • packages/apps/node-runtime/src/lib/require.ts
  • apps/meteor/server/services/import/service.spec.ts
  • apps/meteor/server/lib/utils/getURL.ts
  • ee/apps/omnichannel-transcript/src/i18n.ts
  • apps/meteor/server/lib/i18n.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/client/meteor/login/facebook.ts
  • apps/meteor/client/meteor/login/google.ts
  • apps/meteor/tests/unit/server/services/omnichannel-analytics/AgentData.tests.ts
  • apps/meteor/server/api/ApiClass.ts
  • apps/meteor/app/utils/lib/getURL.ts
  • apps/meteor/tests/e2e/page-objects/login.ts
  • apps/meteor/ee/server/lib/omnichannel/debounceByParams.ts
  • apps/meteor/server/bridges/slack/slackbridge.ts
  • apps/meteor/client/meteor/login/twitter.ts
  • apps/meteor/client/meteor/login/meteorDeveloperAccount.ts
  • apps/meteor/server/lib/media/file-upload/lib/FileUpload.ts
  • packages/cas-validate/src/validate.ts
  • apps/meteor/server/settings/functions/settings.mocks.ts
  • apps/meteor/app/utils/client/getURL.ts
  • apps/meteor/ee/server/cron/readReceiptsArchive.ts
📚 Learning: 2026-02-24T19:22:48.358Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/omnichannel/omnichannel-send-pdf-transcript.spec.ts:66-67
Timestamp: 2026-02-24T19:22:48.358Z
Learning: In Playwright end-to-end tests (e.g., under apps/meteor/tests/e2e/...), prefer locating elements by translated text (getByText) and ARIA roles (getByRole) over data-qa attributes. If translation values change, update the corresponding test locators accordingly. Never use data-qa locators. This guideline applies to all Playwright e2e test specs in the repository and helps keep tests robust to UI text changes and accessible semantics.

Applied to files:

  • apps/meteor/server/services/import/service.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
📚 Learning: 2026-03-06T18:10:15.268Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 39397
File: packages/gazzodown/src/code/CodeBlock.spec.tsx:47-68
Timestamp: 2026-03-06T18:10:15.268Z
Learning: In tests (especially those using testing-library/dom/jsdom) for Rocket.Chat components, the HTML <code> element has an implicit ARIA role of 'code'. Therefore, screen.getByRole('code') or screen.findByRole('code') will locate <code> elements even without a role attribute. Do not flag findByRole('code') as invalid in reviews; prefer using the implicit role instead of adding role="code" unless necessary for accessibility.

Applied to files:

  • apps/meteor/server/services/import/service.spec.ts
  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
📚 Learning: 2026-02-24T19:39:42.247Z
Learnt from: juliajforesti
Repo: RocketChat/Rocket.Chat PR: 38493
File: apps/meteor/tests/e2e/page-objects/fragments/message.ts:7-7
Timestamp: 2026-02-24T19:39:42.247Z
Learning: In RocketChat e2e tests, avoid using data-qa attributes to locate elements. Prefer semantic locators such as getByRole, getByLabel, getByText, getByTitle and ARIA-based selectors. Apply this rule to all TypeScript files under apps/meteor/tests/e2e to improve test reliability, accessibility, and maintainability.

Applied to files:

  • apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts
  • apps/meteor/tests/e2e/page-objects/login.ts
📚 Learning: 2026-02-10T16:32:42.586Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 38528
File: apps/meteor/client/startup/roles.ts:14-14
Timestamp: 2026-02-10T16:32:42.586Z
Learning: In Rocket.Chat's Meteor client code, DDP streams use EJSON and Date fields arrive as Date objects; do not manually construct new Date() in stream handlers (for example, in sdk.stream()). Only REST API responses return plain JSON where dates are strings, so implement explicit conversion there if needed. Apply this guidance to all TypeScript files under apps/meteor/client to ensure consistent date handling in DDP streams and REST responses.

Applied to files:

  • apps/meteor/client/meteor/login/facebook.ts
  • apps/meteor/client/meteor/login/google.ts
  • apps/meteor/client/meteor/login/twitter.ts
  • apps/meteor/client/meteor/login/meteorDeveloperAccount.ts
📚 Learning: 2026-05-11T20:30:35.265Z
Learnt from: tassoevan
Repo: RocketChat/Rocket.Chat PR: 40480
File: apps/meteor/client/meteor/startup/accounts.ts:59-61
Timestamp: 2026-05-11T20:30:35.265Z
Learning: In Rocket.Chat’s Meteor client code, when calling `dispatchToastMessage` with `{ type: 'error' }`, pass the raw caught error object as `message` without manual normalization. `dispatchToastMessage` is designed to accept `message: unknown` for error toasts, so avoid converting errors to strings (e.g., `String(error)`) or extracting `error.message` before passing them.

Applied to files:

  • apps/meteor/client/meteor/login/facebook.ts
  • apps/meteor/client/meteor/login/google.ts
  • apps/meteor/client/meteor/login/twitter.ts
  • apps/meteor/client/meteor/login/meteorDeveloperAccount.ts
📚 Learning: 2025-12-16T17:29:40.430Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37834
File: apps/meteor/tests/e2e/page-objects/fragments/admin-flextab-emoji.ts:12-22
Timestamp: 2025-12-16T17:29:40.430Z
Learning: In all page-object files under apps/meteor/tests/e2e/page-objects/, import expect from ../../utils/test (Playwright's async expect) instead of from Jest. Jest's expect is synchronous and incompatible with web-first assertions like toBeVisible, which can cause TypeScript errors.

Applied to files:

  • apps/meteor/tests/e2e/page-objects/login.ts
📚 Learning: 2026-06-16T14:13:34.463Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 40974
File: packages/web-ui-registration/package.json:31-31
Timestamp: 2026-06-16T14:13:34.463Z
Learning: In Rocket.Chat’s monorepo, when reviewing a dependency entry and flagging that a specific version “does not exist” (e.g., in package.json), first verify the exact package/version directly against the npm registry (use URLs like https://registry.npmjs.org/<package>/<version> or https://www.npmjs.com/package/<package>/v/<version>). Do not rely on web search results for this check, since they may be stale or cached and may not reflect the latest published versions.

Applied to files:

  • packages/eslint-config/package.json
📚 Learning: 2026-06-16T14:13:49.795Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 40974
File: packages/web-ui-registration/package.json:26-26
Timestamp: 2026-06-16T14:13:49.795Z
Learning: During code reviews that check whether a dependency version exists in package.json (especially for Rocket.Chat’s rocket.chat/fuselage and related rocket.chat/fuselage-* packages), don’t rely on web search results. Instead, verify the version directly against the npm registry (e.g., via the npm registry API or the canonical package URL https://www.npmjs.com/package/<package>/v/<version>) before deciding that a version bump is invalid. If the version is present in the npm registry, do not flag it as invalid.

Applied to files:

  • packages/eslint-config/package.json
📚 Learning: 2026-06-16T14:13:59.986Z
Learnt from: ricardogarim
Repo: RocketChat/Rocket.Chat PR: 40974
File: packages/ui-video-conf/package.json:25-25
Timestamp: 2026-06-16T14:13:59.986Z
Learning: In the Rocket.Chat monorepo, when reviewing a dependency version bump for rocket.chat/fuselage in a package.json, do not flag the new version constraint as “non-existent” or invalid unless you verify the published versions directly from the npm registry (https://www.npmjs.com/package/rocket.chat/fuselage). Don’t rely on search/web results for available versions since they can be stale.

Applied to files:

  • packages/eslint-config/package.json
🪛 ast-grep (0.44.1)
apps/meteor/.scripts/version.js

[warning] 6-6: Avoid require with non-literal values
Context: require(path.resolve(process.cwd(), './package.json'))
Note: [CWE-829] Inclusion of Functionality from Untrusted Control Sphere (dynamic require).

(detect-non-literal-require)

apps/meteor/.scripts/run-ha.ts

[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import type { SpawnOptions } from 'child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)

🔇 Additional comments (25)
apps/meteor/ee/server/lib/omnichannel/debounceByParams.ts (1)

12-12: LGTM!

apps/meteor/.scripts/version.js (1)

6-6: LGTM!

apps/meteor/client/meteor/login/facebook.ts (1)

3-6: LGTM!

apps/meteor/client/meteor/login/google.ts (1)

3-6: LGTM!

apps/meteor/client/meteor/login/meteorDeveloperAccount.ts (1)

2-4: LGTM!

apps/meteor/client/meteor/login/twitter.ts (1)

4-6: LGTM!

apps/meteor/server/api/ApiClass.ts (1)

13-17: LGTM!

apps/meteor/server/lib/i18n.ts (1)

91-92: LGTM!

apps/meteor/server/services/import/service.spec.ts (1)

60-60: LGTM!

apps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.ts (1)

75-75: LGTM!

ee/apps/omnichannel-transcript/src/i18n.ts (1)

19-19: LGTM!

packages/apps/node-runtime/src/lib/require.ts (1)

35-35: LGTM!

eslint.config.mjs (1)

32-36: LGTM!

Also applies to: 252-262, 471-474

packages/eslint-config/index.js (1)

3-5: LGTM!

Also applies to: 36-37, 341-363, 373-378

packages/eslint-config/package.json (1)

27-27: LGTM!

apps/meteor/app/utils/client/getURL.ts (1)

6-6: LGTM!

apps/meteor/app/utils/lib/getURL.ts (1)

40-40: LGTM!

Also applies to: 79-79

apps/meteor/server/lib/utils/getURL.ts (1)

5-5: LGTM!

packages/cas-validate/src/validate.ts (1)

10-10: LGTM!

Also applies to: 18-19, 270-271

apps/meteor/tests/e2e/page-objects/login.ts (1)

49-50: LGTM!

apps/meteor/tests/unit/server/services/omnichannel-analytics/AgentData.tests.ts (1)

73-73: LGTM!

apps/meteor/ee/server/cron/readReceiptsArchive.ts (1)

29-30: LGTM!

Also applies to: 44-46, 72-78, 87-89

apps/meteor/server/bridges/slack/slackbridge.ts (1)

3-3: LGTM!

apps/meteor/server/lib/media/file-upload/lib/FileUpload.ts (1)

460-461: LGTM!

Also applies to: 485-486, 699-703

apps/meteor/server/settings/functions/settings.mocks.ts (1)

44-47: LGTM!

Also applies to: 80-87, 101-108

Comment thread apps/meteor/.scripts/run-ha.ts

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

1 issue found and verified against the latest diff

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/meteor/client/meteor/login/meteorDeveloperAccount.ts">

<violation number="1" location="apps/meteor/client/meteor/login/meteorDeveloperAccount.ts:2">
P3: These `import-x/no-duplicates` disable directives suppress a rule that isn't being violated here — `MeteorDeveloperAccounts` and `OAuth` are each imported once. These look like stale directives that were missed by the unused-directive cleanup pass described in the PR. Consider removing them.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

@@ -1,7 +1,7 @@
import { Meteor } from 'meteor/meteor';
// eslint-disable-next-line import/no-duplicates
// eslint-disable-next-line import-x/no-duplicates

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P3: These import-x/no-duplicates disable directives suppress a rule that isn't being violated here — MeteorDeveloperAccounts and OAuth are each imported once. These look like stale directives that were missed by the unused-directive cleanup pass described in the PR. Consider removing them.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At apps/meteor/client/meteor/login/meteorDeveloperAccount.ts, line 2:

<comment>These `import-x/no-duplicates` disable directives suppress a rule that isn't being violated here — `MeteorDeveloperAccounts` and `OAuth` are each imported once. These look like stale directives that were missed by the unused-directive cleanup pass described in the PR. Consider removing them.</comment>

<file context>
@@ -1,7 +1,7 @@
 import { Meteor } from 'meteor/meteor';
-// eslint-disable-next-line import/no-duplicates
+// eslint-disable-next-line import-x/no-duplicates
 import { MeteorDeveloperAccounts } from 'meteor/meteor-developer-oauth';
-// eslint-disable-next-line import/no-duplicates
</file context>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The issue is invalid — the directives are not stale; they're load-bearing suppressions of a false positive. I verified by removing them and re-linting; the rule fires immediately:

2:41  error  '.../apps/meteor/.meteor/local/types/packages.d.ts' imported multiple times  import-x/no-duplicates
3:23  error  '.../apps/meteor/.meteor/local/types/packages.d.ts' imported multiple times  import-x/no-duplicates

Root cause: the comment judges by import specifiers, but no-duplicates compares resolved files. apps/meteor/tsconfig.json:25 maps:

"meteor/*": ["./node_modules/@types/meteor/*", ".meteor/local/types/packages.d.ts"]

meteor/meteor resolves to its own @types/meteor declaration, but meteor/meteor-developer-oauth and meteor/oauth have no @types entry, so both fall through to the same catch-all .meteor/local/types/packages.d.ts. To the rule, that's one module imported twice — even though they're genuinely different runtime packages that can't be merged into one import statement. The same false positive existed under the old plugin, which is why these directives predate the migration (they were import/no-duplicates; the PR only renamed them).

Why the cleanup pass didn't remove them: the wipe ran per-workspace precisely so this resolution context applied — from apps/meteor, ESLint reports these directives as used. (An earlier root-cwd pass did wrongly delete them, which broke yarn lint, and they were deliberately restored — it's the trap documented in the PR description.)

No change needed.

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 68.47%. Comparing base (9db6a29) to head (0d4185b).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #41401      +/-   ##
===========================================
+ Coverage    68.44%   68.47%   +0.03%     
===========================================
  Files         4092     4092              
  Lines       158217   158213       -4     
  Branches     28562    28639      +77     
===========================================
+ Hits        108286   108331      +45     
+ Misses       44893    44845      -48     
+ Partials      5038     5037       -1     
Flag Coverage Δ
e2e 59.19% <ø> (+<0.01%) ⬆️
e2e-api 45.77% <ø> (+0.28%) ⬆️
unit 70.32% <90.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

tassoevan and others added 2 commits July 15, 2026 18:29
…-import-x

Migrates the shared ESLint config to eslint-plugin-import-x, keeping the
same effective rule set:

- Rename all `import/*` rules and settings to `import-x/*`, including
  overrides in the root eslint.config.mjs and inline disable directives
- Configure resolution via `import-x/resolver-next` with a node-first
  resolver chain (`exportsFields: []` preserves the old
  eslint-import-resolver-node behavior of ignoring package `exports`
  maps) followed by the TypeScript resolver
- Drop the now-unused `eslint-plugin-import/minimatch` yarn resolution

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Wipes all disable directives that no longer suppress anything, as
reported by `reportUnusedDisableDirectives` and removed with
`eslint --fix --fix-type directive` run per workspace.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tassoevan
tassoevan force-pushed the chore/eslint-import-x branch from f387ed3 to 0d4185b Compare July 15, 2026 21:29
@ggazzo ggazzo added the stat: QA assured Means it has been tested and approved by a company insider label Jul 16, 2026
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Jul 16, 2026
@ggazzo

ggazzo commented Jul 16, 2026

Copy link
Copy Markdown
Member

/jira ARCH-2086

@ggazzo
ggazzo merged commit 7720156 into develop Jul 16, 2026
83 of 85 checks passed
@ggazzo
ggazzo deleted the chore/eslint-import-x branch July 16, 2026 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stat: QA assured Means it has been tested and approved by a company insider stat: ready to merge PR tested and approved waiting for merge type: chore

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants