Skip to content

refactor: replace lodash.isplainobject with is-plain-obj"#4601

Merged
escapedcat merged 2 commits intoconventional-changelog:masterfrom
hyperz111:lodash.isplainobject
Jan 23, 2026
Merged

refactor: replace lodash.isplainobject with is-plain-obj"#4601
escapedcat merged 2 commits intoconventional-changelog:masterfrom
hyperz111:lodash.isplainobject

Conversation

@hyperz111
Copy link
Contributor

@hyperz111 hyperz111 commented Jan 23, 2026

User description

Description

Replace lodash.isplainobject with is-plain-obj. Extracted from #4596.

Motivation and Context

lodash per-method packages is NOT maintained. So i replace lodash.isplainobject with is-plain-obj.

Usage examples

Nothing.

How Has This Been Tested?

I run test in each changed packages (@commitlint/cz-commitlint, @commitlint/load).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

PR Type

Enhancement


Description

  • Replace unmaintained lodash.isplainobject with is-plain-obj

  • Update dependencies in @commitlint/cz-commitlint package

  • Update dependencies in @commitlint/load package

  • Remove unused type definitions for lodash package


Diagram Walkthrough

flowchart LR
  A["lodash.isplainobject<br/>unmaintained"] -- "replace with" --> B["is-plain-obj<br/>maintained alternative"]
  B -- "update in" --> C["@commitlint/cz-commitlint"]
  B -- "update in" --> D["@commitlint/load"]
Loading

File Walkthrough

Relevant files
Dependencies
prompts.ts
Update isPlainObject import source                                             

@commitlint/cz-commitlint/src/store/prompts.ts

  • Replace import statement from lodash.isplainobject to is-plain-obj
+1/-1     
load.ts
Update isPlainObject import source                                             

@commitlint/load/src/load.ts

  • Replace import statement from lodash.isplainobject to is-plain-obj
+1/-1     
package.json
Update dependencies and remove type definitions                   

@commitlint/cz-commitlint/package.json

  • Replace lodash.isplainobject ^4.0.6 with is-plain-obj ^4.1.0 in
    dependencies
  • Remove @types/lodash.isplainobject from devDependencies
+1/-2     
package.json
Update dependencies and remove type definitions                   

@commitlint/load/package.json

  • Replace lodash.isplainobject ^4.0.6 with is-plain-obj ^4.1.0 in
    dependencies
  • Remove @types/lodash.isplainobject from devDependencies
+1/-2     

@qodo-code-review
Copy link

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@qodo-code-review
Copy link

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Downgrade dependency for broader compatibility

Downgrade is-plain-obj to ^3.0.0 to maintain CommonJS compatibility and ensure
robust detection of plain objects, which was lost in version 4.x.

@commitlint/cz-commitlint/package.json [50]

-"is-plain-obj": "^4.1.0",
+"is-plain-obj": "^3.0.0",
  • Apply / Chat
Suggestion importance[1-10]: 9

__

Why: The suggestion correctly identifies that is-plain-obj@^4.1.0 is an ESM-only module, which would be a breaking change for CommonJS consumers, and also points out a functional regression regarding cross-realm object detection.

High
  • More

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Replaces the unmaintained lodash.isplainobject dependency with is-plain-obj across the affected commitlint packages.

Changes:

  • Swap lodash.isplainobject imports to is-plain-obj in @commitlint/load and @commitlint/cz-commitlint
  • Update package dependencies to remove lodash.isplainobject and @types/lodash.isplainobject, and add is-plain-obj
  • Refresh yarn.lock accordingly (removes lodash.isplainobject / types entries, adds is-plain-obj@^4.1.0)

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
yarn.lock Removes lodash.isplainobject and its types; adds lock entry for is-plain-obj@^4.1.0.
@commitlint/load/src/load.ts Updates isPlainObject import to use is-plain-obj.
@commitlint/load/package.json Replaces lodash.isplainobject dependency with is-plain-obj and removes the related @types devDependency.
@commitlint/cz-commitlint/src/store/prompts.ts Updates isPlainObject import to use is-plain-obj.
@commitlint/cz-commitlint/package.json Replaces lodash.isplainobject dependency with is-plain-obj and removes the related @types devDependency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@escapedcat
Copy link
Member

Thanks!

@escapedcat escapedcat merged commit 2fec7ae into conventional-changelog:master Jan 23, 2026
18 checks passed
This was referenced Jan 30, 2026
This was referenced Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants