fix(deps): remove stale ua-parser-js resolution and move dev tooling#6982
Conversation
…to devDependencies
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
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 (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Walkthroughpackage.json updated: Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Suggested labels
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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 |
|
duplicate of #6892 |
|
also have you tried running app after removing |
|
To clarify, I’m not proposing removing ua-parser-js`from dependencies, since it is used in LiveChat. The suggestion was only to evaluate whether the |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
package.json (1)
130-130:⚠️ Potential issue | 🔴 CriticalRemove
@types/ua-parser-jsdevDependency — ua-parser-js@1.0.33 ships with built-in TypeScript definitionsThe pinning of
ua-parser-js@1.0.33in dependencies is correct. However, the@types/ua-parser-js@^0.7.36devDependency (line 175) should be removed entirely. Starting with v1.0.x, ua-parser-js includes its own TypeScript definitions and does not require a separate@types/package. Having both can cause type/export conflicts.The usage in RoomInfoView (getOS, getBrowser methods) works fine without the DefinitelyTyped package—simply rely on the library's built-in types.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@package.json` at line 130, Remove the unnecessary devDependency `@types/ua-parser-js` from package.json because ua-parser-js@1.0.33 includes its own TypeScript definitions; specifically delete the `@types/ua-parser-js` entry from the devDependencies section, update any lockfile (npm/yarn/pnpm) by reinstalling to remove the package, and ensure code using UAParser types (e.g., RoomInfoView methods getOS and getBrowser) compiles against the built-in types without importing from `@types`.
🧹 Nitpick comments (1)
package.json (1)
202-203: Correct moves — both packages belong indevDependencies
eslint-import-resolver-typescriptandlint-stagedare dev-only tools with no runtime role; placing them indevDependenciesis accurate.Separately,
lint-staged@11.1.0is significantly stale (released ~2021; current is ~15.x). The version itself wasn't changed by this PR, but since the entry is being touched anyway, this is a low-cost opportunity to bump it.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@package.json` around lines 202 - 203, Move the two packages "eslint-import-resolver-typescript" and "lint-staged" out of dependencies into devDependencies in package.json (they are build/dev tools, not runtime), and while doing so update "lint-staged" to a modern minor/major (e.g., ^15.0.0) to replace the stale 11.1.0 entry; ensure package.json ends up with "eslint-import-resolver-typescript" and the bumped "lint-staged" listed under devDependencies and removed from dependencies, then run install to update lockfile.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (1)
package.json
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-02-05T13:55:00.974Z
Learnt from: Rohit3523
Repo: RocketChat/Rocket.Chat.ReactNative PR: 6930
File: package.json:101-101
Timestamp: 2026-02-05T13:55:00.974Z
Learning: In this repository, the dependency on react-native-image-crop-picker should reference the RocketChat fork (RocketChat/react-native-image-crop-picker) with explicit commit pins, not the upstream ivpusic/react-native-image-crop-picker. Update package.json dependencies (and any lockfile) to point to the fork URL and a specific commit, ensuring edge-to-edge Android fixes are included. This pattern should apply to all package.json files in the repo that declare this dependency.
Applied to files:
package.json
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@package.json`:
- Line 202: The devDependencies entry for "eslint-import-resolver-typescript"
uses 4 spaces instead of a tab, causing inconsistent indentation in
package.json; update the indentation for the "eslint-import-resolver-typescript"
line to use a single tab character so it matches the other entries (preserve the
existing double quotes and comma), then save and validate the JSON (or run your
formatter/linter) to ensure the file remains valid.
- Line 198: The package.json currently pins "react-dom": "18.2.0" which is
incompatible with "react": "19.0.0"; update the dependency to a
React-19-compatible version (e.g., change "react-dom" to "^19.0.0") so the major
versions match, then reinstall deps (and update the lockfile) to remove peer
dependency warnings and ensure Storybook and runtime use matching
React/ReactDOM; alternatively, if you must keep react-dom@18, downgrade "react"
to "18.2.0" so the majors match.
---
Outside diff comments:
In `@package.json`:
- Line 130: Remove the unnecessary devDependency `@types/ua-parser-js` from
package.json because ua-parser-js@1.0.33 includes its own TypeScript
definitions; specifically delete the `@types/ua-parser-js` entry from the
devDependencies section, update any lockfile (npm/yarn/pnpm) by reinstalling to
remove the package, and ensure code using UAParser types (e.g., RoomInfoView
methods getOS and getBrowser) compiles against the built-in types without
importing from `@types`.
---
Nitpick comments:
In `@package.json`:
- Around line 202-203: Move the two packages "eslint-import-resolver-typescript"
and "lint-staged" out of dependencies into devDependencies in package.json (they
are build/dev tools, not runtime), and while doing so update "lint-staged" to a
modern minor/major (e.g., ^15.0.0) to replace the stale 11.1.0 entry; ensure
package.json ends up with "eslint-import-resolver-typescript" and the bumped
"lint-staged" listed under devDependencies and removed from dependencies, then
run install to update lockfile.
Proposed changes
Dependency hygiene cleanup in [package.json]
ua-parser-js@1.0.2resolution override — it was silently downgrading the declared1.0.33to1.0.2and was semver-incompatible withexpo-device's^0.7.33requirement, causing Yarn warnings and duplicate installations.lint-stagedandeslint-import-resolver-typescriptfromdependenciestodevDependencies— both are dev-only tools that don't belong in production dependencies.Issue(s)
#6981
How to test or reproduce
rm -rf node_modules yarn.lock && yarn installua-parser-jsresolution warningsyarn list ua-parser-js→ should show1.0.33(root) and0.7.41(expo-device)yarn test→ all 776 tests passyarn run android→ BUILD SUCCESSFULScreenshots
N/A — no UI changes.
Types of changes
Checklist
Further comments
Summary by CodeRabbit