-
Notifications
You must be signed in to change notification settings - Fork 273
refactor: update remaining parseInt to Number.parseInt for ES2015+ co… #2459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
refactor: update remaining parseInt to Number.parseInt for ES2015+ co… #2459
Conversation
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Summary by CodeRabbit
WalkthroughAll changes systematically replace the use of the global Changes
Poem
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
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 details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lock
is excluded by!**/yarn.lock
,!**/*.lock
📒 Files selected for processing (9)
controllers/auction.js
(1 hunks)controllers/discordactions.js
(2 hunks)controllers/profileDiffs.js
(1 hunks)controllers/progresses.js
(1 hunks)controllers/users.js
(1 hunks)utils/extensionRequests.js
(1 hunks)utils/progresses.js
(1 hunks)utils/tasks.js
(1 hunks)utils/users.js
(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: Suvidh-kaushik
PR: Real-Dev-Squad/website-backend#2450
File: services/impersonationRequests.ts:11-11
Timestamp: 2025-06-26T20:08:47.146Z
Learning: In services/impersonationRequests.ts, the functions `updateImpersonationRequest` and `getImpersonationRequestById` are being imported from models/impersonationRequests but appear missing because they exist in previous PRs that need to be merged before this PR. This is expected behavior for dependent PRs and the build failures are temporary.
Learnt from: surajmaity1
PR: Real-Dev-Squad/website-backend#2386
File: test/unit/services/oooRequest.test.ts:9-9
Timestamp: 2025-03-16T05:28:26.722Z
Learning: PRs #2383 and #2386 are related. PR #2383 implements the OOO request feature with the services/oooRequest.ts file, while PR #2386 adds tests for this feature. This creates a dependency where PR #2386 requires PR #2383 to be merged first.
🧬 Code Graph Analysis (2)
utils/users.js (1)
controllers/tasks.js (1)
searchParams
(154-154)
controllers/discordactions.js (2)
controllers/progresses.js (4)
limit
(119-119)offset
(120-120)nextPage
(121-121)prevPage
(122-122)utils/progresses.js (2)
limit
(136-136)offset
(137-137)
🔇 Additional comments (7)
controllers/profileDiffs.js (1)
25-25
: LGTM: Clean modernization to Number.parseIntThe change from
parseInt(size)
toNumber.parseInt(size)
follows ES2015+ standards and maintains identical functionality for parsing the pagination size parameter.utils/tasks.js (1)
77-81
: LGTM: Consistent modernization for pagination parsingBoth changes from
parseInt(page)
toNumber.parseInt(page)
andparseInt(size)
toNumber.parseInt(size)
properly modernize the integer parsing while maintaining identical functionality for pagination parameters.utils/progresses.js (1)
136-137
: LGTM: Proper modernization with radix preservationBoth changes from
parseInt(size, 10)
toNumber.parseInt(size, 10)
andparseInt(page, 10)
toNumber.parseInt(page, 10)
correctly modernize the integer parsing while preserving the explicit radix parameter for safe decimal parsing.utils/extensionRequests.js (1)
31-31
: LGTM: Clean modernization for size parameter parsingThe change from
parseInt(size)
toNumber.parseInt(size)
properly modernizes the integer parsing while maintaining identical functionality for the size parameter transformation.utils/users.js (1)
220-220
: LGTM: Consistent modernization for search parameter parsingThe change from
parseInt(value)
toNumber.parseInt(value)
properly modernizes the integer parsing for the "days" search parameter while maintaining identical functionality.controllers/progresses.js (1)
119-122
: Excellent ES2015+ compliance with proper radix usage.The changes to
Number.parseInt
are well-implemented with consistent radix parameter usage. This maintains the existing pagination logic while modernizing the code according to ES2015+ standards.controllers/discordactions.js (1)
130-131
: Consistent ES2015+ modernization with proper radix usage.The changes to
Number.parseInt
are correctly implemented with consistent radix parameter usage across all pagination parsing operations. This aligns well with similar changes in other controller files likecontrollers/progresses.js
and maintains the existing pagination logic.Also applies to: 142-143
c172f6b
to
f974a4a
Compare
…mpliance
Date: 18 Jul 2025
Developer Name: Pankaj Tyagi
Issue Ticket Number
N/A – General code modernization based on reviewer feedback in PR #2458
Description
This PR refactors the remaining instances of parseInt to Number.parseInt in the following files for ES2015+ compliance and better code clarity:
controllers/users.js
controllers/progresses.js
controllers/aucion.js
controllers/discordactions.js
controllers/profileDiffs.js
utils/extensionRequests.js
utils/users.js
utils/progressess.js
utils/tasks.js
This follows up on the conversation in PR #2458, where reviewers suggested keeping the bug fix and code modernization in separate pull requests for better scope separation.
Documentation Updated?
N/A – No documentation changes required
Under Feature Flag
Database Changes
Breaking Changes
Development Tested?
Changes tested locally and behaviour remains consistent.
Screenshots
Test Coverage
Additional Notes
This PR was created in response to reviewer feedback on PR #2458. Keeping code modernization separate from bug fixes makes the review and future rollback process cleaner.
Description by Korbit AI
What change is being made?
Refactor all instances of
parseInt
usage toNumber.parseInt
for ES2015+ compliance throughout the codebase.Why are these changes being made?
This change improves code clarity by adopting a more explicit namespace for parsing integers, aligning with modern JavaScript best practices and ES2015+ standards, ensuring consistency across the project. By using
Number.parseInt
, it also improves scope clarity by avoiding potential misunderstandings related to the globalparseInt
function.