Skip to content

Conversation

Rohit3523
Copy link
Collaborator

@Rohit3523 Rohit3523 commented Oct 14, 2025

Proposed changes

This PR updates the existing prettier workflow by adding an ESLint auto-fix step. The workflow now also automatically lints the code and commits the changes made by ESLint. This ensures consistent linting across the codebase, reducing manual formatting and review effort.

Issue(s)

https://rocketchat.atlassian.net/browse/COMM-37

How to test or reproduce

Screenshots

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

Summary by CodeRabbit

  • Chores
    • CI workflow now runs formatting and linting, and commits fixes when detected to keep the codebase consistent.
  • Tests
    • Corrected test string escaping and adjusted test formatting; no behavioral changes.
  • Style
    • Standardized arrow-function parameter formatting and quote usage across the codebase; formatting-only updates with no impact on runtime behavior.

Copy link
Contributor

coderabbitai bot commented Oct 14, 2025

Walkthrough

Adds an ESLint --fix step and related commit/push to the Prettier GitHub Actions workflow; standardizes arrow-function parameter syntax (adds parentheses) across several sagas and tests; fixes a test string escape; minor script log/format tweaks. No behavioral logic changes.

Changes

Cohort / File(s) Summary of changes
CI workflow: Prettier + ESLint
.github/workflows/prettier.yml
Adds an ESLint --fix run after Prettier, detects ESLint-induced changes, and conditionally commits/pushes. Renames the "check changes" step id and updates dependent references and commit message.
Sagas: arrow param formatting
app/sagas/createChannel.js, app/sagas/createDiscussion.js, app/sagas/deepLinking.js, app/sagas/login.js, app/sagas/rooms.js
Normalizes single-parameter arrow callbacks to parenthesized form (param) => { ... } in multiple create/update/prepare operations and a Promise executor; no logic changes.
Tests: escaping and formatting
app/containers/MessageComposer/helpers/getMentionRegexp.test.js, app/containers/UnreadBadge/getUnreadStyle.test.js
Escapes a single quote in a test string and adds parentheses around a single arrow-function parameter. No behavioral changes.
Scripts: minor stylistic tweaks
scripts/organize-translations.js
Switches an error log string to single quotes and parenthesizes a forEach callback parameter. Behavior unchanged.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Runner as GitHub Actions Runner
  participant Repo as Repository
  participant Prettier
  participant ESLint
  participant Git as Git

  Runner->>Repo: checkout
  Runner->>Prettier: run Prettier --write
  Runner->>Runner: detect Prettier changes (steps.changes)
  alt Prettier changes
    Runner->>Git: commit & push Prettier changes
  else no Prettier changes
    note right of Runner: skip commit
  end

  Runner->>ESLint: run ESLint --fix
  Runner->>Runner: detect ESLint changes (steps.changes.outputs.changes)
  alt ESLint changes
    Runner->>Git: commit & push eslint changes
  else no ESLint changes
    note right of Runner: skip commit
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • diegolmello
  • OtavioStasiak

Poem

I nibble at commas, hop round each quote,
Parens snug as a pocket in my coat.
Prettier danced, ESLint gave a wink,
Commits hopped forward before a blink.
A rabbit's cheer for tidy lines and scope! 🐇

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title concisely communicates that this PR is a chore adding ESLint auto-fix to the codebase, matching the primary change of updating the Prettier workflow with an ESLint step and committing lint fixes. It is clear, specific, and avoids unnecessary detail while highlighting the main improvement. Team members scanning PRs can immediately understand the focus on ESLint automation from the title.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore.eslint-autofix

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.

@Rohit3523 Rohit3523 requested a deployment to approve_e2e_testing October 14, 2025 17:27 — with GitHub Actions Waiting
@Rohit3523 Rohit3523 requested a deployment to official_android_build October 14, 2025 17:30 — with GitHub Actions Waiting
@Rohit3523 Rohit3523 requested a deployment to experimental_ios_build October 14, 2025 17:30 — with GitHub Actions Waiting
@Rohit3523 Rohit3523 requested a deployment to experimental_android_build October 14, 2025 17:30 — with GitHub Actions Waiting
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

🧹 Nitpick comments (2)
.github/workflows/prettier.yml (2)

29-31: Use repo-pinned ESLint (yarn) and run ESLint before Prettier for determinism.

Avoid npx (network fetch, version drift). Run ESLint from devDeps and place Prettier last.

Apply this diff:

-      - name: Run Prettier
-        run: yarn prettier --write .
-
-      - name: Run ESLint
-        run: npx eslint . --fix
+      - name: Run ESLint
+        run: yarn eslint . --fix
+
+      - name: Run Prettier
+        run: yarn prettier --write .

43-50: Rename commit step and confirm skip CI behavior

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Jira integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b0b499e and 24be7d6.

📒 Files selected for processing (1)
  • .github/workflows/prettier.yml (2 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). (2)
  • GitHub Check: ESLint and Test / run-eslint-and-test
  • GitHub Check: format
🔇 Additional comments (1)
.github/workflows/prettier.yml (1)

33-33: Id rename is consistent.

id: changes matches the later conditional usage. LGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants