Skip to content

Conversation

@tassoevan
Copy link
Contributor

@tassoevan tassoevan commented Sep 12, 2025

Proposed changes (including videos or screenshots)

Issue(s)

ARCH-1810

Steps to test or reproduce

Further comments

Summary by CodeRabbit

  • Style

    • Standardized import ordering to group external and internal imports.
    • Added targeted lint suppressions in social login modules (Facebook, GitHub, Google, Meteor Developer, Twitter). No runtime changes.
  • Chores

    • Enhanced ESLint config to enable TypeScript import resolution.
    • Added dependency: eslint-import-resolver-typescript.
  • User Impact

    • No user-facing changes; behavior remains unchanged.

@tassoevan tassoevan added this to the 7.11.0 milestone Sep 12, 2025
@tassoevan tassoevan requested review from a team as code owners September 12, 2025 20:08
@dionisio-bot
Copy link
Contributor

dionisio-bot bot commented Sep 12, 2025

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

@changeset-bot
Copy link

changeset-bot bot commented Sep 12, 2025

⚠️ No Changeset found

Latest commit: 9b1c295

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
Copy link
Contributor

coderabbitai bot commented Sep 12, 2025

Walkthrough

Adds ESLint disable comments to several Meteor auth override and server import lines; updates eslint-config to group external/internal imports together and enables a TypeScript import resolver by adding resolver settings and a new dependency.

Changes

Cohort / File(s) Summary of Changes
Meteor auth overrides: lint suppressions
apps/meteor/client/meteor/overrides/login/facebook.ts, apps/meteor/client/meteor/overrides/login/github.ts, apps/meteor/client/meteor/overrides/login/google.ts, apps/meteor/client/meteor/overrides/login/meteorDeveloperAccount.ts, apps/meteor/client/meteor/overrides/login/twitter.ts
Inserted // eslint-disable-next-line import/no-duplicates before specific OAuth/provider imports. No runtime or API changes.
API server: lint suppression
apps/meteor/app/api/server/ApiClass.ts
Added ESLint disable comments before imports from meteor/ddp-common and meteor/rate-limit. No runtime or API changes.
ESLint config: import ordering
packages/eslint-config/imports/index.js
Changed import/order groups from ['builtin','external','internal', ['parent','sibling','index']] to ['builtin', ['external','internal'], ['parent','sibling','index']].
ESLint config: TypeScript resolver
packages/eslint-config/standard/index.js, packages/eslint-config/package.json
Added settings.import.resolver.typescript: {} and dependency "eslint-import-resolver-typescript": "~4.4.4" to enable TypeScript import resolution for eslint-plugin-import.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

stat: ready to merge, stat: QA assured

Suggested reviewers

  • aleksandernsilva

Pre-merge checks (3 passed)

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "chore(eslint): Enable TypeScript resolver for eslint-plugin-import" is concise, follows conventional commit style, and accurately reflects the primary intent of the changeset (adding a TypeScript resolver and related ESLint config/dependency changes). It names the subsystem (eslint) and the key action (enable TypeScript resolver for eslint-plugin-import) without listing files or using vague language, so a reviewer scanning PR history will understand the main change. The title is appropriately focused and proportional to the scope shown in the raw summary.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Poem

I twitch my ears at tidy lines, hop-hop, no dupes in sight,
Imports queue in single file, both inside-outside right.
TS paths now clearly marked, my burrow’s lint is bright—
Carrots sorted, rules resolved,
A cleaner code delight! 🥕✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "chore(eslint): Enable TypeScript resolver for eslint-plugin-import" accurately and succinctly states the PR's primary change—adding and enabling the TypeScript import resolver in the ESLint configuration (reflected in packages/eslint-config/standard/index.js and the added dependency in package.json). The raw_summary also shows only lint-related edits elsewhere (ESLint suppressions and import/order grouping tweaks), so the title reflects the main intent. The phrasing is concise, specific, and appropriate for a chore-scoped change.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/eslint-typescript-resolution

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 625da7f and 9b1c295.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (9)
  • apps/meteor/app/api/server/ApiClass.ts (1 hunks)
  • apps/meteor/client/meteor/overrides/login/facebook.ts (1 hunks)
  • apps/meteor/client/meteor/overrides/login/github.ts (1 hunks)
  • apps/meteor/client/meteor/overrides/login/google.ts (1 hunks)
  • apps/meteor/client/meteor/overrides/login/meteorDeveloperAccount.ts (1 hunks)
  • apps/meteor/client/meteor/overrides/login/twitter.ts (1 hunks)
  • packages/eslint-config/imports/index.js (1 hunks)
  • packages/eslint-config/package.json (1 hunks)
  • packages/eslint-config/standard/index.js (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • apps/meteor/client/meteor/overrides/login/github.ts
🚧 Files skipped from review as they are similar to previous changes (8)
  • packages/eslint-config/package.json
  • apps/meteor/app/api/server/ApiClass.ts
  • apps/meteor/client/meteor/overrides/login/twitter.ts
  • apps/meteor/client/meteor/overrides/login/facebook.ts
  • apps/meteor/client/meteor/overrides/login/meteorDeveloperAccount.ts
  • apps/meteor/client/meteor/overrides/login/google.ts
  • packages/eslint-config/standard/index.js
  • packages/eslint-config/imports/index.js
⏰ 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). (4)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: Builds matrix rust bindings against alpine
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/meteor/client/meteor/overrides/login/meteorDeveloperAccount.ts (1)

22-23: Missing Random import (runtime/TS error)

Random.secret() is used but Random isn’t imported in this file. Align with other providers.

+import { Random } from '@rocket.chat/random';
♻️ Duplicate comments (4)
apps/meteor/client/meteor/overrides/login/twitter.ts (1)

4-7: Avoid inline disables for import/no-duplicates

Same suggestion as in google.ts: prefer a config-level ignore for meteor/* modules so these lines aren’t needed.

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

2-5: Avoid inline disables for import/no-duplicates

Same as other overrides; handle Meteor modules in ESLint config and remove these comments.

apps/meteor/client/meteor/overrides/login/github.ts (1)

3-7: Avoid inline disables for import/no-duplicates

Centralize the Meteor handling in ESLint config; then remove these disables.

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

3-7: Avoid inline disables for import/no-duplicates

Handle Meteor packages in ESLint config and remove these comments (same as other override files).

🧹 Nitpick comments (8)
apps/meteor/client/meteor/overrides/login/google.ts (2)

3-7: Prefer config-level fix over scattered inline disables

Instead of per-line import/no-duplicates disables, address Meteor packages globally in the ESLint config (see comment on packages/eslint-config/imports/index.js). This lets you drop these comments repo-wide.


83-103: Remove redundant Object.assign of the same params

loginUrlParameters is built with the properties already, then immediately reassigned with the same keys. Drop the second assignment.

-		Object.assign(loginUrlParameters, {
-			response_type: 'code',
-			client_id: config.clientId,
-			scope,
-			redirect_uri: OAuth._redirectUri('google', config),
-			state: OAuth._stateParam(loginStyle, credentialToken, options.redirectUrl),
-		});
apps/meteor/app/api/server/ApiClass.ts (2)

16-19: Combine type and value imports to avoid duplicate-import rule

You can import both type and value from the same module and drop the disable.

-import type { RateLimiterOptionsToCheck } from 'meteor/rate-limit';
-// eslint-disable-next-line import/no-duplicates
-import { RateLimiter } from 'meteor/rate-limit';
+import { type RateLimiterOptionsToCheck, RateLimiter } from 'meteor/rate-limit';

13-14: Unnecessary disable?

ddp and ddp-common are distinct modules; if lint still flags duplicates, prefer a config tweak over per-line disables (see config comment). Otherwise, remove this comment.

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

11-20: Centralize Meteor handling to eliminate inline disables

Ignore Meteor package paths at the resolver layer so import/no-duplicates and friends don’t misfire on meteor/* imports across the codebase.

 settings: {
   'import/resolver': {
     node: {
       extensions: ['.mjs', '.js', '.json'],
     },
   },
   'import/extensions': ['.js', '.mjs', '.jsx'],
   'import/core-modules': [],
-  'import/ignore': ['node_modules', '\\.(coffee|scss|css|less|hbs|svg|json)$'],
+  'import/ignore': ['node_modules', '\\.(coffee|scss|css|less|hbs|svg|json)$', '^meteor/.+$'],
 },
packages/eslint-config/standard/index.js (3)

125-125: Resolve @types packages automatically

Enable alwaysTryTypes so the resolver also finds @types/* packages, reducing false positives for type-only imports.

Apply this diff:

-					typescript: {},
+					typescript: { alwaysTryTypes: true },

121-126: Consider moving resolver config to top-level settings for consistency

Right now the TS resolver is only active for **/*.ts(x) files. If JS files import modules via TS path aliases (through Babel plugins or runtime aliasing), import/no-unresolved may still fire. Consider defining the same resolver at the top-level settings to cover mixed codebases.

Example (outside this hunk, near Lines 7-13):

settings: {
  'import/resolver': {
    node: { extensions: ['.js', '.mjs', '.cjs', '.ts', '.tsx'] },
    typescript: { alwaysTryTypes: true },
  },
},

123-124: Optional: include ESM/CJS extensions

If the repo contains .mjs/.cjs files, include them to avoid import/no-unresolved noise.

Apply this diff:

-					node: {
-						extensions: ['.js', '.ts', '.tsx'],
-					},
+					node: {
+						extensions: ['.js', '.mjs', '.cjs', '.ts', '.tsx'],
+					},
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7787147 and 625da7f.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (9)
  • apps/meteor/app/api/server/ApiClass.ts (1 hunks)
  • apps/meteor/client/meteor/overrides/login/facebook.ts (1 hunks)
  • apps/meteor/client/meteor/overrides/login/github.ts (1 hunks)
  • apps/meteor/client/meteor/overrides/login/google.ts (1 hunks)
  • apps/meteor/client/meteor/overrides/login/meteorDeveloperAccount.ts (1 hunks)
  • apps/meteor/client/meteor/overrides/login/twitter.ts (1 hunks)
  • packages/eslint-config/imports/index.js (1 hunks)
  • packages/eslint-config/package.json (1 hunks)
  • packages/eslint-config/standard/index.js (1 hunks)
⏰ 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). (3)
  • GitHub Check: 📦 Build Packages
  • GitHub Check: CodeQL-Build
  • GitHub Check: CodeQL-Build
🔇 Additional comments (3)
packages/eslint-config/package.json (1)

14-14: Verify TypeScript import resolver is active for consumers

packages/eslint-config/package.json declares eslint-import-resolver-typescript (~4.4.4) and packages/eslint-config/standard/index.js enables the "typescript" resolver in the TS override, but several consumer .eslintrc.json files override settings with "import/resolver": node (examples: packages/ui-client/.eslintrc.json, packages/ui-composer/.eslintrc.json, packages/ui-avatar/.eslintrc.json, packages/fuselage-ui-kit/.eslintrc.json, packages/livechat/.eslintrc.json).

Run locally to confirm for a real TS file:
eslint --print-config path/to/consumer/file.ts | jq '.settings["import/resolver"]'

If the output does not include "typescript", remove/merge the local "import/resolver" entries or explicitly add "typescript": {} to the consuming config.

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

151-151: Merging external and internal groups LGTM

Combining them should reduce noisy diffs across the monorepo.

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

121-126: TS resolver addition — LGTM

Adding typescript under import/resolver inside the TS override will fix many import/no-unresolved cases for path aliases and TS files.

@codecov
Copy link

codecov bot commented Sep 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.53%. Comparing base (c5ee569) to head (9b1c295).
⚠️ Report is 7 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #36934      +/-   ##
===========================================
- Coverage    66.54%   66.53%   -0.02%     
===========================================
  Files         3344     3344              
  Lines       114629   114629              
  Branches     21094    21093       -1     
===========================================
- Hits         76281    76269      -12     
- Misses       35658    35667       +9     
- Partials      2690     2693       +3     
Flag Coverage Δ
e2e 57.67% <ø> (-0.02%) ⬇️
unit 71.23% <ø> (-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 tassoevan force-pushed the chore/eslint-typescript-resolution branch from 625da7f to 9b1c295 Compare September 15, 2025 18:19
@ggazzo ggazzo added the stat: QA assured Means it has been tested and approved by a company insider label Sep 16, 2025
@dionisio-bot dionisio-bot bot added the stat: ready to merge PR tested and approved waiting for merge label Sep 16, 2025
@ggazzo ggazzo merged commit 665d719 into develop Sep 16, 2025
80 of 90 checks passed
@ggazzo ggazzo deleted the chore/eslint-typescript-resolution branch September 16, 2025 12:47
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants