fix(cz-commitlint): handle modifiers correctly#4667
fix(cz-commitlint): handle modifiers correctly#4667escapedcat merged 1 commit intoconventional-changelog:masterfrom
Conversation
Review Summary by QodoFix VS16 placement for emojis with skin tone modifiers
WalkthroughsDescription• Fix VS16 placement for emojis with modifiers like skin tones • Insert VS16 between base emoji and modifiers, not at end • Add comprehensive test coverage for emoji normalization • Improve documentation of emoji normalization logic Diagramflowchart LR
A["Emoji with modifier<br/>e.g., 🛠🏽"] --> B["Extract base char<br/>and modifiers"]
B --> C["Check if VS16 needed"]
C --> D["Insert VS16 between<br/>base and modifiers"]
D --> E["Normalized emoji<br/>🛠\uFE0F🏽"]
File Changes1. @commitlint/cz-commitlint/src/services/getRuleQuestionConfig.ts
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewⓘ The new review experience is currently in Beta. Learn more |
|
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. |
This comment was marked as resolved.
This comment was marked as resolved.
When adding VS16 to emojis with modifiers, VS16 can not be appended at the end - this creates an invalid unicode symbol. VS16 must be appended between emoji and modifiers.
7b31d1d to
420f1ef
Compare
There was a problem hiding this comment.
Pull request overview
Updates emoji normalization in @commitlint/cz-commitlint to ensure terminal column alignment remains consistent when enum option emojis include additional codepoints (notably skin tone modifiers), and adds regression coverage.
Changes:
- Adjust
normalizeEmojito insert VS16 (U+FE0F) immediately after the emoji base codepoint within a single grapheme cluster (rather than appending at the end of the string). - Add a test case covering normalization behavior for emojis with skin tone modifiers (and ensuring Emoji_Presentation emojis remain unchanged).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| @commitlint/cz-commitlint/src/services/getRuleQuestionConfig.ts | Fixes emoji normalization to place VS16 after the base character so modifiers/ZWJ sequences aren’t disrupted. |
| @commitlint/cz-commitlint/src/services/getRuleQuestionConfig.test.ts | Adds regression test for skin-tone-modified emoji normalization and expected enum list formatting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
When adding VS16 to emojis with modifiers, VS16 can not be appended at the end - this creates an invalid unicode symbol. VS16 must be appended between emoji and modifiers.
Description
When emojis are used with modifiers like skin tones the VS16 must be added between emoji and modifier, not at the end.
Motivation and Context
This was a review finding of the fix that added VS16 for emojis without modifiers as a potential bug.
Usage examples
How Has This Been Tested?
Types of changes
Checklist: