chore: scope jest, lint, prettier, and tsc to ignore .worktrees directory#7131
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✅ Files skipped from review due to trivial changes (4)
📜 Recent review details⏰ 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). (1)
WalkthroughAdds Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested labels
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@jest.config.js`:
- Line 2: The regex in testPathIgnorePatterns currently has a leading literal
slash which prevents the ^ anchor from matching; update the pattern in
jest.config.js for testPathIgnorePatterns (the entry currently
'/(^|\\/)\\.worktrees\\//') to remove the leading slash so it reads
'(^|\\/)\\.worktrees\\/' (or an equivalent pattern that matches either
start-of-string or a path separator before .worktrees, e.g.,
'^(.*/)?\\.worktrees\\/') so .worktrees paths are correctly ignored.
🪄 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: d0d8346b-bad7-4bf2-b025-71b6ac0116e5
📒 Files selected for processing (4)
.eslintignore.prettierignorejest.config.jstsconfig.json
📜 Review details
⏰ 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). (1)
- GitHub Check: ESLint and Test / run-eslint-and-test
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{js,jsx,ts,tsx,json}
📄 CodeRabbit inference engine (CLAUDE.md)
Configure Prettier with tabs, single quotes, 130 character width, no trailing commas, arrow parens avoid, and bracket same line
Files:
tsconfig.jsonjest.config.js
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (CLAUDE.md)
Use ESLint with
@rocket.chat/eslint-configbase configuration including React, React Native, TypeScript, and Jest plugins
Files:
jest.config.js
**/*.{js,ts,jsx,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{js,ts,jsx,tsx}: Use descriptive names for functions, variables, and classes that clearly convey their purpose
Write comments that explain the 'why' behind code decisions, not the 'what'
Keep functions small and focused on a single responsibility
Use const by default, let when reassignment is needed, and avoid var
Prefer async/await over .then() chains for handling asynchronous operations
Use explicit error handling with try/catch blocks for async operations
Avoid deeply nested code; refactor complex logic into helper functions
Files:
jest.config.js
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
Repo: RocketChat/Rocket.Chat.ReactNative PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-07T17:49:17.538Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Use ESLint with rocket.chat/eslint-config base configuration including React, React Native, TypeScript, and Jest plugins
Learnt from: CR
Repo: RocketChat/Rocket.Chat.ReactNative PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-07T17:49:17.538Z
Learning: Run yarn prettier-lint and TZ=UTC yarn test for modified files before committing
Learnt from: CR
Repo: RocketChat/Rocket.Chat.ReactNative PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-07T17:49:17.538Z
Learning: Applies to **/*.{js,jsx,ts,tsx,json} : Configure Prettier with tabs, single quotes, 130 character width, no trailing commas, arrow parens avoid, and bracket same line
📚 Learning: 2026-04-07T17:49:25.836Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat.ReactNative PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-04-07T17:49:25.836Z
Learning: Applies to **/*.{ts,tsx} : Use TypeScript for type safety; add explicit type annotations to function parameters and return types
Applied to files:
tsconfig.json
📚 Learning: 2026-04-07T17:49:17.538Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat.ReactNative PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-07T17:49:17.538Z
Learning: Applies to **/*.{ts,tsx} : Use TypeScript with strict mode enabled and configure baseUrl to app/ for import resolution
Applied to files:
tsconfig.json
📚 Learning: 2026-04-07T17:49:17.538Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat.ReactNative PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-07T17:49:17.538Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Use ESLint with rocket.chat/eslint-config base configuration including React, React Native, TypeScript, and Jest plugins
Applied to files:
tsconfig.jsonjest.config.js
📚 Learning: 2026-04-07T17:49:17.538Z
Learnt from: CR
Repo: RocketChat/Rocket.Chat.ReactNative PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-04-07T17:49:17.538Z
Learning: Applies to **/*.{js,jsx,ts,tsx,json} : Configure Prettier with tabs, single quotes, 130 character width, no trailing commas, arrow parens avoid, and bracket same line
Applied to files:
tsconfig.jsonjest.config.js
🔇 Additional comments (3)
.eslintignore (1)
8-8: LGTM: ESLint scope now correctly excludes.worktrees/.This matches the PR intent and prevents linting sibling worktree files.
.prettierignore (1)
12-12: LGTM: Prettier ignore entry is correct.Adding
.worktrees/here is consistent with the rest of the tooling exclusions.tsconfig.json (1)
73-73: LGTM: TypeScript exclusion is correctly scoped.
"**/.worktrees/**"is an appropriate addition to keeptsclimited to the active worktree.
diegolmello
left a comment
There was a problem hiding this comment.
Babysit Review (Round 1)
CI: ESLint + Tests PASSED.
Auto-fixed:
- jest.config.js line 2 — Jest regex pattern was broken (leading slash made caret anchor impossible to match). Replaced with simple string approach. CodeRabbit also flagged this.
Decisions (no action needed):
- Pattern style inconsistency (string vs regex) — functionally identical, simplified version is cleaner.
- .prettierignore trailing-slash inconsistency — cosmetic.
Avoid running test/lint/typecheck commands on sibling git worktrees by ignoring the standard .worktrees/ directory in all four tools.
3c175f9 to
deebf72
Compare
Proposed changes
Avoid running test/lint/typecheck commands on sibling git worktrees by ignoring the standard
.worktrees/directory in all four tools:/(^|\\/)\.worktrees\\//totestPathIgnorePatterns.worktrees/to.eslintignore.worktrees/to.prettierignore**/.worktrees/**totsconfig.jsonexcludeIssues
https://rocketchat.atlassian.net/browse/CORE-2098
How to test or reproduce
Run any of the four commands from a worktree inside
.worktrees/and verify only files from the current worktree are processed.Types of changes
Checklist
Summary by CodeRabbit