chore(eslint): Replace eslint-plugin-import with eslint-plugin-import-x - #41401
Conversation
|
Looks like this PR is ready to merge! 🎉 |
|
WalkthroughThe pull request migrates ESLint import rules from ChangesESLint import migration
Client and package cleanup
Server cleanup
Implementation simplifications
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
d798571 to
f387ed3
Compare
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (54)
apps/meteor/.scripts/run-ha.tsapps/meteor/.scripts/version.jsapps/meteor/app/utils/client/getURL.tsapps/meteor/app/utils/lib/getURL.tsapps/meteor/client/components/GenericUpsellModal/GenericUpsellModal.spec.tsxapps/meteor/client/definitions/global.d.tsapps/meteor/client/meteor/login/facebook.tsapps/meteor/client/meteor/login/google.tsapps/meteor/client/meteor/login/meteorDeveloperAccount.tsapps/meteor/client/meteor/login/twitter.tsapps/meteor/client/views/admin/ABAC/ABACAttributesTab/AttributesForm.spec.tsxapps/meteor/client/views/admin/engagementDashboard/channels/useChannelsList.tsapps/meteor/client/views/admin/engagementDashboard/messages/useMessageOrigins.tsapps/meteor/client/views/admin/engagementDashboard/messages/useMessagesSent.tsapps/meteor/client/views/admin/engagementDashboard/messages/useTopFivePopularChannels.tsapps/meteor/client/views/admin/engagementDashboard/users/useActiveUsers.tsapps/meteor/client/views/admin/engagementDashboard/users/useUsersByTimeOfTheDay.tsapps/meteor/client/views/e2e/EnterE2EPasswordModal/EnterE2EPasswordModal.spec.tsxapps/meteor/client/views/navigation/sidebar/RoomList/SidebarItemWithData.tsxapps/meteor/client/views/omnichannel/components/outboundMessage/components/OutboundMessageWizard/steps/MessageStep.spec.tsxapps/meteor/client/views/omnichannel/components/outboundMessage/components/OutboundMessageWizard/steps/RecipientStep.spec.tsxapps/meteor/client/views/omnichannel/components/outboundMessage/components/OutboundMessageWizard/steps/RepliesStep.spec.tsxapps/meteor/ee/server/cron/readReceiptsArchive.tsapps/meteor/ee/server/lib/omnichannel/debounceByParams.tsapps/meteor/server/api/ApiClass.tsapps/meteor/server/api/lib/isValidQuery.tsapps/meteor/server/bridges/slack/slackbridge.tsapps/meteor/server/lib/error-handler/RocketChat.ErrorHandler.tsapps/meteor/server/lib/i18n.tsapps/meteor/server/lib/media/file-upload/lib/FileUpload.tsapps/meteor/server/lib/messages/isTheLastMessage.tsapps/meteor/server/lib/rooms/updateGroupDMsName.tsapps/meteor/server/lib/utils/getURL.tsapps/meteor/server/services/import/service.spec.tsapps/meteor/server/services/omnichannel-analytics/service.tsapps/meteor/server/settings/SettingsRegistry.tsapps/meteor/server/settings/functions/settings.mocks.tsapps/meteor/server/settings/startup.tsapps/meteor/server/ufs/ufs-server.tsapps/meteor/server/ufs/ufs-store.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/tests/e2e/page-objects/login.tsapps/meteor/tests/unit/server/services/omnichannel-analytics/AgentData.tests.tsee/apps/omnichannel-transcript/src/i18n.tsee/packages/license/src/licenseImp.tseslint.config.mjspackage.jsonpackages/apps/node-runtime/src/lib/require.tspackages/cas-validate/src/validate.tspackages/ddp-client/src/types/methods.tspackages/eslint-config/index.jspackages/eslint-config/package.jsonpackages/mock-providers/src/MockedAppRootBuilder.tsxpackages/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.tsapps/meteor/server/services/import/service.spec.tsapps/meteor/server/lib/utils/getURL.tsee/apps/omnichannel-transcript/src/i18n.tsapps/meteor/server/lib/i18n.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/client/meteor/login/facebook.tsapps/meteor/client/meteor/login/google.tsapps/meteor/tests/unit/server/services/omnichannel-analytics/AgentData.tests.tsapps/meteor/server/api/ApiClass.tsapps/meteor/app/utils/lib/getURL.tsapps/meteor/tests/e2e/page-objects/login.tsapps/meteor/ee/server/lib/omnichannel/debounceByParams.tsapps/meteor/server/bridges/slack/slackbridge.tsapps/meteor/client/meteor/login/twitter.tsapps/meteor/client/meteor/login/meteorDeveloperAccount.tspackages/eslint-config/index.jsapps/meteor/server/lib/media/file-upload/lib/FileUpload.tspackages/cas-validate/src/validate.tsapps/meteor/server/settings/functions/settings.mocks.tsapps/meteor/app/utils/client/getURL.tsapps/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.tsextension for test files (e.g.,login.spec.ts)
Files:
apps/meteor/server/services/import/service.spec.tsapps/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 inapps/meteor/tests/e2e/directory
Avoid usingpage.locator()in Playwright tests - always prefer semantic locators such aspage.getByRole(),page.getByLabel(),page.getByText(), orpage.getByTitle()
Usetest.beforeAll()andtest.afterAll()for setup/teardown in Playwright tests
Usetest.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
Useexpectmatchers for assertions (toEqual,toContain,toBeTruthy,toHaveLength, etc.) instead ofassertstatements in Playwright tests
Usepage.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.tsapps/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.tsapps/meteor/server/services/import/service.spec.tsapps/meteor/server/lib/utils/getURL.tsee/apps/omnichannel-transcript/src/i18n.tsapps/meteor/server/lib/i18n.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/client/meteor/login/facebook.tsapps/meteor/client/meteor/login/google.tsapps/meteor/tests/unit/server/services/omnichannel-analytics/AgentData.tests.tsapps/meteor/server/api/ApiClass.tsapps/meteor/app/utils/lib/getURL.tsapps/meteor/tests/e2e/page-objects/login.tsapps/meteor/ee/server/lib/omnichannel/debounceByParams.tsapps/meteor/server/bridges/slack/slackbridge.tsapps/meteor/client/meteor/login/twitter.tsapps/meteor/client/meteor/login/meteorDeveloperAccount.tsapps/meteor/server/lib/media/file-upload/lib/FileUpload.tspackages/cas-validate/src/validate.tsapps/meteor/server/settings/functions/settings.mocks.tsapps/meteor/app/utils/client/getURL.tsapps/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.tsapps/meteor/server/services/import/service.spec.tsapps/meteor/server/lib/utils/getURL.tsee/apps/omnichannel-transcript/src/i18n.tsapps/meteor/server/lib/i18n.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/client/meteor/login/facebook.tsapps/meteor/client/meteor/login/google.tsapps/meteor/tests/unit/server/services/omnichannel-analytics/AgentData.tests.tsapps/meteor/server/api/ApiClass.tsapps/meteor/app/utils/lib/getURL.tsapps/meteor/tests/e2e/page-objects/login.tsapps/meteor/ee/server/lib/omnichannel/debounceByParams.tsapps/meteor/server/bridges/slack/slackbridge.tsapps/meteor/client/meteor/login/twitter.tsapps/meteor/client/meteor/login/meteorDeveloperAccount.tsapps/meteor/server/lib/media/file-upload/lib/FileUpload.tspackages/cas-validate/src/validate.tsapps/meteor/server/settings/functions/settings.mocks.tsapps/meteor/app/utils/client/getURL.tsapps/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.tsapps/meteor/server/services/import/service.spec.tsapps/meteor/server/lib/utils/getURL.tsee/apps/omnichannel-transcript/src/i18n.tsapps/meteor/server/lib/i18n.tsapps/meteor/tests/e2e/e2e-encryption/e2ee-legacy-format.spec.tsapps/meteor/client/meteor/login/facebook.tsapps/meteor/client/meteor/login/google.tsapps/meteor/tests/unit/server/services/omnichannel-analytics/AgentData.tests.tsapps/meteor/server/api/ApiClass.tsapps/meteor/app/utils/lib/getURL.tsapps/meteor/tests/e2e/page-objects/login.tsapps/meteor/ee/server/lib/omnichannel/debounceByParams.tsapps/meteor/server/bridges/slack/slackbridge.tsapps/meteor/client/meteor/login/twitter.tsapps/meteor/client/meteor/login/meteorDeveloperAccount.tsapps/meteor/server/lib/media/file-upload/lib/FileUpload.tspackages/cas-validate/src/validate.tsapps/meteor/server/settings/functions/settings.mocks.tsapps/meteor/app/utils/client/getURL.tsapps/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.tsapps/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.tsapps/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.tsapps/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.tsapps/meteor/client/meteor/login/google.tsapps/meteor/client/meteor/login/twitter.tsapps/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.tsapps/meteor/client/meteor/login/google.tsapps/meteor/client/meteor/login/twitter.tsapps/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
There was a problem hiding this comment.
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 | |||
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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 Report❌ Patch coverage is Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
…-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>
f387ed3 to
0d4185b
Compare
|
/jira ARCH-2086 |
Proposed changes (including videos or screenshots)
Replaces
eslint-plugin-import(~2.32.0) with its actively maintained forkeslint-plugin-import-x(~4.17.1) across the monorepo, keeping the effective rule set identical.@rocket.chat/eslint-configimport/*rules and settings renamed toimport-x/*with the same severities and options, including the overrides in the rooteslint.config.mjsand every inline disable directive.import-x/resolver-nextAPI with an explicit chain: a node resolver first (withexportsFields: []to keep the oldeslint-import-resolver-nodebehavior of ignoring packageexportsmaps — required for deep imports likecsv-parse/lib/syncandswiper/modules/*.css), then the TypeScript resolver. The order matters: the TS resolver alone would resolve packages likenode-fetchto their@types/*declarations and produce falseimport-x/namederrors.eslint-plugin-import/minimatchyarn resolution (import-x already uses minimatch 9/10).Unused directive cleanup
reportUnusedDisableDirectivesalready enabled, wiped all staleeslint-disabledirectives repo-wide viaeslint --fix --fix-type directive, run per workspace so resolution context matches how turbo lints (notablymeteor/*imports only resolve from withinapps/meteor). 42 files touched, removals only — no behavioral autofixes were applied.Rule parity was verified by diffing
eslint --print-configoutput before/after, and by injecting deliberate violations (import order, duplicated imports, statement-before-import, missing group separation) in files acrossapps/meteor,packages/*,ee/packages/*, andee/apps/*— every one was reported as animport-x/*error.No changeset: developer tooling only, no end-user impact.
Issue(s)
Steps to test or reproduce
yarn lint— all 71 tasks pass with no errors and no unused-directive warnings.yarn lint— the violation is reported as animport-x/*error.Further comments
eslint-plugin-importhas 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 inpackages/eslint-config/index.js.🤖 Generated with Claude Code
Summary by CodeRabbit
Chores
Tests
Impact
Task: ARCH-2256