refactor(ensure): replace all lodash string methods with kasi and manual#4602
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||
|
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. |
|
:D I'm not always at the computer |
|
Thanks! |
|
Ok, maybe the problem in #4596 is on |
… and manual (#4602)" This reverts commit a1ef07e. kasi@2.0.1 has a bug where it incorrectly identifies lowercase Cyrillic text as PascalCase/TitleCase, causing the subject-case rule to reject valid lowercase subjects in non-Latin scripts. Restores lodash-based case detection which correctly handles non-Latin alphabets including Cyrillic, Chinese, Arabic, and Hebrew. Related to #4620
* Revert "refactor(ensure): replace all lodash string methods with kasi and manual (#4602)" This reverts commit a1ef07e. kasi@2.0.1 has a bug where it incorrectly identifies lowercase Cyrillic text as PascalCase/TitleCase, causing the subject-case rule to reject valid lowercase subjects in non-Latin scripts. Restores lodash-based case detection which correctly handles non-Latin alphabets including Cyrillic, Chinese, Arabic, and Hebrew. Related to #4620 * test(rules): add non-Latin script coverage for subject-case rule Add regression tests for lowercase and uppercase subjects in: - Cyrillic (Russian) - Chinese - Arabic - Hebrew - Mixed Latin + Cyrillic These tests ensure the subject-case rule correctly handles non-Latin alphabets and prevent future regressions like the kasi@2.0.1 bug. Fixes #4620
User description
Description
Replace all
lodashstring methods withkasiand manual code. Extracted from #4596.Motivation and Context
kasiis lighter than 5 lodash string method packages.Usage examples
How Has This Been Tested?
I run test in each changed packages (
@commitlint/ensure).Types of changes
Checklist:
PR Type
Enhancement
Description
Replace 5 lodash string packages with lighter kasi library
Update imports from individual lodash modules to kasi
Simplify pascal-case and sentence-case implementations
Remove unnecessary @types/lodash dependencies
Diagram Walkthrough
File Walkthrough
index.test.ts
Update camelCase import and usage@commitlint/ensure/src/index.test.ts
toCamelCasefromlodash.camelcase
camelCase()function call withtoCamelCase()to-case.ts
Replace lodash with kasi for case conversion@commitlint/ensure/src/to-case.ts
toPascalCasedirectlypackage.json
Update dependencies to use kasi@commitlint/ensure/package.json