You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
chore(mobile): fix eslint rules and import order in mobile unit tests - #8074
This PR fixes the ESLint failures in @agenta/mobile#lint affecting upstream/main CI workflows:
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/).
Fixes the import/order between internal (@/**) and parent package imports in playgroundChatMessage.render.test.tsx and playgroundChatTurns.render.test.tsx.
Demo
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
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.
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.
Agenta-AI/agenta#8076: Reorders imports in mobile playground tests to address the same lint failures.
Agenta-AI/agenta#8070: Reorders imports in mobile playground tests to address the same lint failures.
Agenta-AI/agenta#8084: Changes the same two test files, including their import order.
Merge Risk: Low · up to 2b682
Replace the two internal relative imports with the package's public exports before merging.
Pre-merge checks: 5
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main changes: fixing mobile ESLint rules and import order in unit tests.
Description check
The description directly explains the ESLint configuration and import-order changes, along with testing results and affected files.
Docstring Coverage
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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.
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)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
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.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes the ESLint failures in
@agenta/mobile#lintaffectingupstream/mainCI workflows:web/mobile/eslint.config.mjswithweb/eslint.config.mjsandweb/packages/eslint.config.mjsby setting"@typescript-eslint/no-empty-function": "off", resolving 12 unexpected empty function/method errors in test mocks (tests/unit/).import/orderbetween internal (@/**) and parent package imports inplaygroundChatMessage.render.test.tsxandplaygroundChatTurns.render.test.tsx.Demo
Testing
pnpm run lintinweb/mobile: Passed cleanly with 0 errors (was failing with 14 errors).tsx scripts/generate-shadcn-tokens.ts --check: Tokens verified up to date.Checklist