Skip to content

chore(mobile): fix eslint rules and import order in mobile unit tests - #8074

Open
yunusarda-sudo wants to merge 2 commits into
Agenta-AI:mainfrom
yunusarda-sudo:fix/mobile-unit-test-lint
Open

yunusarda-sudo wants to merge 2 commits into
Agenta-AI:mainfrom
yunusarda-sudo:fix/mobile-unit-test-lint

Conversation

@yunusarda-sudo

@yunusarda-sudo yunusarda-sudo commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR fixes the ESLint failures in @agenta/mobile#lint affecting upstream/main CI workflows:

  1. Aligns web/mobile/eslint.config.mjs with web/eslint.config.mjs and web/packages/eslint.config.mjs by setting "@typescript-eslint/no-empty-function": "off", resolving 12 unexpected empty function/method errors in test mocks (tests/unit/).
  2. Fixes the import/order between internal (@/**) and parent package imports in playgroundChatMessage.render.test.tsx and playgroundChatTurns.render.test.tsx.

Demo

Mobile ESLint Verification Evidence

Testing

  • pnpm run lint in web/mobile: Passed cleanly with 0 errors (was failing with 14 errors).
  • tsx scripts/generate-shadcn-tokens.ts --check: Tokens verified up to date.
  • Prettier formatting verified on all modified files.

Checklist

  • Demo shows the real app running this branch (not a mock-up or recreated UI), or is marked N/A
  • Relevant tests pass locally
  • Relevant linting and formatting pass locally
  • I have signed the CLA, or I will sign it when the bot prompts me

Signed-off-by: Yunus Ardaguney <yunusarda-sudo@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

✅ Thanks @yunusarda-sudo! This PR now meets the contribution requirements and has been reopened. A maintainer will review it soon.

@github-actions github-actions Bot added the incomplete-pr PR is missing required template sections or a demo recording label Nov 3, 2026
@github-actions github-actions Bot closed this Nov 3, 2026
@github-actions github-actions Bot removed the incomplete-pr PR is missing required template sections or a demo recording label Nov 3, 2026
@github-actions github-actions Bot reopened this Nov 3, 2026
@yunusarda-sudo

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Summary

Summary by CodeRabbit

  • Chores
    • Updated code-quality rules for mobile test files. App functionality is unchanged.
  • Tests
    • Reordered imports in two mobile test files; test behavior is unchanged.

The mobile ESLint configuration disables @typescript-eslint/no-empty-function for matching test files. Two playground unit test files reorder imports without changing test logic or runtime behavior.

Changes: Mobile lint updates

Layer / File(s) Summary
ESLint setting and playground test imports
web/mobile/eslint.config.mjs, web/mobile/tests/unit/playgroundChatMessage.render.test.tsx, web/mobile/tests/unit/playgroundChatTurns.render.test.tsx
The ESLint configuration disables @typescript-eslint/no-empty-function for matching test files. The two test files reorder imports.

Estimated code review effort: 1 (Trivial) | ~4 minutes

Possibly related PRs

Merge Risk: Low · up to 2b682

Replace the two internal relative imports with the package's public exports before merging.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main changes: fixing mobile ESLint rules and import order in unit tests.
Description check Passed The description directly explains the ESLint configuration and import-order changes, along with testing results and affected files.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 3 files.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@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.

Additional comments: 1
web/mobile/eslint.config.mjs-79-79: 1

79-79: Minor · Maintainability & Code Quality · Quick win

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Scope the rule override to test files.

The rule is disabled in the shared rules object. This removes empty-function checks from both src and tests. If only test mocks require this exception, use a test-only flat-config override instead. (raw.githubusercontent.com)

Proposed fix
-            "@typescript-eslint/no-empty-function": "off",
...
+    {
+        files: ["tests/**/*.{js,jsx,ts,tsx}"],
+        rules: {
+            "@typescript-eslint/no-empty-function": "off",
+        },
+    },
Review info
Run configuration
  • Source mode: Auto
  • Repository: Agenta-AI/agenta
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: ab04932
  • Layers: Repository YAML (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a36ef07f-a7b2-432d-81b7-77ce70b953ff
Commits

Reviewing files that changed from the base of the PR and between ab04932 and 75ac475.

Files selected for processing: 3
  • web/mobile/eslint.config.mjs
  • web/mobile/tests/unit/playgroundChatMessage.render.test.tsx
  • web/mobile/tests/unit/playgroundChatTurns.render.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

@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: 2

Review info
Run configuration
  • Source mode: Auto
  • Repository: Agenta-AI/agenta
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: ab04932
  • Layers: Repository YAML (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dbafaeb4-1614-4fd8-ad7f-fcd9cb099eda
Commits

Reviewing files that changed from the base of the PR and between ab04932 and 2b68286.

Files selected for processing: 3
  • web/mobile/eslint.config.mjs
  • web/mobile/tests/unit/playgroundChatMessage.render.test.tsx
  • web/mobile/tests/unit/playgroundChatTurns.render.test.tsx

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.


import {usePlaygroundSelection} from "@/features/playground/usePlaygroundSelection"

import {ChatMessage} from "../../../packages/agenta-playground-ui/src/panels/chat/ChatMessage"

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.

Minor · Maintainability & Code Quality · Quick win

Use the @agenta/playground-ui public export.

This import reaches another package's internal src tree. Replace it with the exported @agenta/playground-ui subpath for ChatMessage. Add that export first if it does not exist.

As per coding guidelines: across packages, use package-name exported subpaths, not relative internal paths.

Source: Coding guidelines


import {usePlaygroundSelection} from "@/features/playground/usePlaygroundSelection"

import {ChatTurns} from "../../../packages/agenta-playground-ui/src/panels/chat/ChatTurns"

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.

Minor · Maintainability & Code Quality · Quick win

Use the @agenta/playground-ui public export.

This import reaches another package's internal src tree. Replace it with the exported @agenta/playground-ui subpath for ChatTurns. Add that export first if it does not exist.

As per coding guidelines: across packages, use package-name exported subpaths, not relative internal paths.

Source: Coding guidelines

This branch has not been deployed

No deployments
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.

1 participant