fix(cz-commitlint): add VS16 to single character emojis#4666
Conversation
Review Summary by QodoAdd VS16 normalization for single-character emoji alignment
WalkthroughsDescription• Normalize single-character emojis by adding VS16 (U+FE0F) for consistent terminal alignment • Implement emoji presentation detection using Unicode properties and grapheme segmentation • Add comprehensive test coverage for emoji normalization with various emoji types Diagramflowchart LR
A["Raw emoji input"] --> B["normalizeEmoji function"]
B --> C["Detect emoji type"]
C --> D1["Emoji_Presentation or has VS16/VS15"]
C --> D2["Text-style emoji base"]
D1 --> E["Return unchanged"]
D2 --> F["Append VS16 U+FE0F"]
E --> G["Aligned terminal display"]
F --> G
File Changes1. @commitlint/cz-commitlint/src/services/getRuleQuestionConfig.ts
|
Code Review by Qodo
1. Intl.Segmenter typings missing
|
|
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. |
0985316 to
6fdf099
Compare
There was a problem hiding this comment.
Pull request overview
This PR improves the @commitlint/cz-commitlint interactive enum prompt formatting by normalizing certain emojis to use emoji presentation (VS16), avoiding terminal column misalignment when some emojis render at text-width.
Changes:
- Add an emoji normalizer that appends VS16 (U+FE0F) for single-grapheme emojis that are
\p{Emoji}but not\p{Emoji_Presentation}and don’t already specify a variation selector. - Apply normalization when building enum list display strings.
- Extend unit tests to cover VS16 normalization behavior (including when
emojiInHeaderis enabled).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| @commitlint/cz-commitlint/src/services/getRuleQuestionConfig.ts | Introduces normalizeEmoji() and applies it to enum emoji rendering. |
| @commitlint/cz-commitlint/src/services/getRuleQuestionConfig.test.ts | Adds/updates tests asserting VS16 normalization and adjusted spacing expectations. |
Comments suppressed due to low confidence (1)
@commitlint/cz-commitlint/src/services/getRuleQuestionConfig.ts:110
- The normalization currently affects
valuewhenemojiInHeaderis true, meaning the selected enum value (and therefore the committed header) can change from the emoji configured by the user (e.g. 🛠 -> 🛠️ via VS16). If the intent is only to fix prompt alignment, consider using the normalized emoji forname/display but keepingvaluebased on the raw configured emoji (trimmed), or make this behavior opt-in to avoid a breaking change for existing configs.
if (enumDescription) {
const rawEmoji = enumDescriptions[enumName]?.emoji;
const emoji = rawEmoji ? normalizeEmoji(rawEmoji) : rawEmoji;
const emojiPrefix = emoji
? `${emoji} `
: hasConsistentEmojiUsage
? ""
: " ";
const paddedName = `${enumName}:`.padEnd(longest + 4);
const name = `${emojiPrefix}${paddedName}${enumDescription}`;
const value =
emojiInHeader && emoji ? `${emoji.trim()} ${enumName}` : enumName;
💡 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.
Single character emojis like 🛠 or 🗑 do not align with 2 character emojis in the rendered menu.
6fdf099 to
b89b000
Compare
…ocker tag to v21 (#63) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [cr.codefloe.com/docker.io/commitlint/commitlint](https://github.com/conventional-changelog/commitlint) | major | `20.5.3` → `21.0.0` | --- ### Release Notes <details> <summary>conventional-changelog/commitlint (cr.codefloe.com/docker.io/commitlint/commitlint)</summary> ### [`v21.0.0`](https://github.com/conventional-changelog/commitlint/blob/HEAD/CHANGELOG.md#2100-2026-05-08) [Compare Source](conventional-changelog/commitlint@v20.5.3...v21.0.0) ##### Bug Fixes - widen cz-commitlint inquirer peer dep to support v9-v12 [#​4554](conventional-changelog/commitlint#4554) ([#​4682](conventional-changelog/commitlint#4682)) ([341f0c4](conventional-changelog/commitlint@341f0c4)) - chore!: minimum node version v22 ([#​4679](conventional-changelog/commitlint#4679)) ([ac2b3f4](conventional-changelog/commitlint@ac2b3f4)), closes [#​4679](conventional-changelog/commitlint#4679) ##### BREAKING CHANGES - drop node v18 and v20 support * Bump engines to >=v22 in all 39 package.json files * Update [@​types/node](https://github.com/types/node) to ^22.0.0 * Update CI matrix to \[22, 24] * Update Ubuntu baseline job to ubuntu:26.04 * Update Dockerfile.ci, .mise.toml, .codesandbox/ci.json * Update pre-commit hook to use --ignore-engines * Update README and docs Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> #### [20.5.3](conventional-changelog/commitlint@v20.5.2...v20.5.3) (2026-04-30) **Note:** Version bump only for package [@​commitlint/root](https://github.com/commitlint/root) #### [20.5.2](conventional-changelog/commitlint@v20.5.1...v20.5.2) (2026-04-25) ##### Bug Fixes - update dependency global-directory to v5 ([#​4698](conventional-changelog/commitlint#4698)) ([a8b6224](conventional-changelog/commitlint@a8b6224)) #### [20.5.1](conventional-changelog/commitlint@v20.5.0...v20.5.1) (2026-03-31) ##### Bug Fixes - **cz-commitlint:** add VS16 to single character emojis ([#​4666](conventional-changelog/commitlint#4666)) ([9e3e2d3](conventional-changelog/commitlint@9e3e2d3)) - **cz-commitlint:** handle modifiers correctly ([#​4667](conventional-changelog/commitlint#4667)) ([5a3ebf5](conventional-changelog/commitlint@5a3ebf5)) - update dependency global-directory to v5 ([#​4671](conventional-changelog/commitlint#4671)) ([a300d32](conventional-changelog/commitlint@a300d32)) ##### Reverts - Revert "fix: update dependency global-directory to v5 ([#​4671](conventional-changelog/commitlint#4671))" ([#​4677](conventional-changelog/commitlint#4677)) ([0f124c9](conventional-changelog/commitlint@0f124c9)), closes [#​4671](conventional-changelog/commitlint#4671) [#​4677](conventional-changelog/commitlint#4677) </details> --- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4zMS4wIiwidXBkYXRlZEluVmVyIjoiNDMuMzEuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Co-authored-by: devxy-bot <no-reply@devxy.io> Reviewed-on: https://codefloe.com/devxy/ansible-posit/pulls/63
…ocker tag to v21 (#88) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [cr.codefloe.com/docker.io/commitlint/commitlint](https://github.com/conventional-changelog/commitlint) | major | `20.5.3` → `21.0.1` | --- ### Release Notes <details> <summary>conventional-changelog/commitlint (cr.codefloe.com/docker.io/commitlint/commitlint)</summary> ### [`v21.0.1`](https://github.com/conventional-changelog/commitlint/blob/HEAD/CHANGELOG.md#2101-2026-05-12) [Compare Source](conventional-changelog/commitlint@v21.0.0...v21.0.1) ##### Bug Fixes - **load:** only resolve relative formatter paths ([#​4761](conventional-changelog/commitlint#4761)) ([f8be069](conventional-changelog/commitlint@f8be069)) - **types:** add presetConfig to ParserPreset interface ([#​4749](conventional-changelog/commitlint#4749)) ([e402cd4](conventional-changelog/commitlint@e402cd4)), closes [#​4748](conventional-changelog/commitlint#4748) ### [`v21.0.0`](https://github.com/conventional-changelog/commitlint/blob/HEAD/CHANGELOG.md#2100-2026-05-08) [Compare Source](conventional-changelog/commitlint@v20.5.3...v21.0.0) ##### Bug Fixes - widen cz-commitlint inquirer peer dep to support v9-v12 [#​4554](conventional-changelog/commitlint#4554) ([#​4682](conventional-changelog/commitlint#4682)) ([341f0c4](conventional-changelog/commitlint@341f0c4)) - chore!: minimum node version v22 ([#​4679](conventional-changelog/commitlint#4679)) ([ac2b3f4](conventional-changelog/commitlint@ac2b3f4)), closes [#​4679](conventional-changelog/commitlint#4679) ##### BREAKING CHANGES - drop node v18 and v20 support * Bump engines to >=v22 in all 39 package.json files * Update [@​types/node](https://github.com/types/node) to ^22.0.0 * Update CI matrix to \[22, 24] * Update Ubuntu baseline job to ubuntu:26.04 * Update Dockerfile.ci, .mise.toml, .codesandbox/ci.json * Update pre-commit hook to use --ignore-engines * Update README and docs Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> #### [20.5.3](conventional-changelog/commitlint@v20.5.2...v20.5.3) (2026-04-30) **Note:** Version bump only for package [@​commitlint/root](https://github.com/commitlint/root) #### [20.5.2](conventional-changelog/commitlint@v20.5.1...v20.5.2) (2026-04-25) ##### Bug Fixes - update dependency global-directory to v5 ([#​4698](conventional-changelog/commitlint#4698)) ([a8b6224](conventional-changelog/commitlint@a8b6224)) #### [20.5.1](conventional-changelog/commitlint@v20.5.0...v20.5.1) (2026-03-31) ##### Bug Fixes - **cz-commitlint:** add VS16 to single character emojis ([#​4666](conventional-changelog/commitlint#4666)) ([9e3e2d3](conventional-changelog/commitlint@9e3e2d3)) - **cz-commitlint:** handle modifiers correctly ([#​4667](conventional-changelog/commitlint#4667)) ([5a3ebf5](conventional-changelog/commitlint@5a3ebf5)) - update dependency global-directory to v5 ([#​4671](conventional-changelog/commitlint#4671)) ([a300d32](conventional-changelog/commitlint@a300d32)) ##### Reverts - Revert "fix: update dependency global-directory to v5 ([#​4671](conventional-changelog/commitlint#4671))" ([#​4677](conventional-changelog/commitlint#4677)) ([0f124c9](conventional-changelog/commitlint@0f124c9)), closes [#​4671](conventional-changelog/commitlint#4671) [#​4677](conventional-changelog/commitlint#4677) </details> --- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4zMS4wIiwidXBkYXRlZEluVmVyIjoiNDMuMzEuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Co-authored-by: devxy-bot <no-reply@devxy.io> Reviewed-on: https://codefloe.com/devxy/ansible-data-science-core/pulls/88
…ocker tag to v21 (#16) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [cr.codefloe.com/docker.io/commitlint/commitlint](https://github.com/conventional-changelog/commitlint) | major | `20.5.3` → `21.0.1` | --- ### Release Notes <details> <summary>conventional-changelog/commitlint (cr.codefloe.com/docker.io/commitlint/commitlint)</summary> ### [`v21.0.1`](https://github.com/conventional-changelog/commitlint/blob/HEAD/CHANGELOG.md#2101-2026-05-12) [Compare Source](conventional-changelog/commitlint@v21.0.0...v21.0.1) ##### Bug Fixes - **load:** only resolve relative formatter paths ([#​4761](conventional-changelog/commitlint#4761)) ([f8be069](conventional-changelog/commitlint@f8be069)) - **types:** add presetConfig to ParserPreset interface ([#​4749](conventional-changelog/commitlint#4749)) ([e402cd4](conventional-changelog/commitlint@e402cd4)), closes [#​4748](conventional-changelog/commitlint#4748) ### [`v21.0.0`](https://github.com/conventional-changelog/commitlint/blob/HEAD/CHANGELOG.md#2100-2026-05-08) [Compare Source](conventional-changelog/commitlint@v20.5.3...v21.0.0) ##### Bug Fixes - widen cz-commitlint inquirer peer dep to support v9-v12 [#​4554](conventional-changelog/commitlint#4554) ([#​4682](conventional-changelog/commitlint#4682)) ([341f0c4](conventional-changelog/commitlint@341f0c4)) - chore!: minimum node version v22 ([#​4679](conventional-changelog/commitlint#4679)) ([ac2b3f4](conventional-changelog/commitlint@ac2b3f4)), closes [#​4679](conventional-changelog/commitlint#4679) ##### BREAKING CHANGES - drop node v18 and v20 support * Bump engines to >=v22 in all 39 package.json files * Update [@​types/node](https://github.com/types/node) to ^22.0.0 * Update CI matrix to \[22, 24] * Update Ubuntu baseline job to ubuntu:26.04 * Update Dockerfile.ci, .mise.toml, .codesandbox/ci.json * Update pre-commit hook to use --ignore-engines * Update README and docs Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> #### [20.5.3](conventional-changelog/commitlint@v20.5.2...v20.5.3) (2026-04-30) **Note:** Version bump only for package [@​commitlint/root](https://github.com/commitlint/root) #### [20.5.2](conventional-changelog/commitlint@v20.5.1...v20.5.2) (2026-04-25) ##### Bug Fixes - update dependency global-directory to v5 ([#​4698](conventional-changelog/commitlint#4698)) ([a8b6224](conventional-changelog/commitlint@a8b6224)) #### [20.5.1](conventional-changelog/commitlint@v20.5.0...v20.5.1) (2026-03-31) ##### Bug Fixes - **cz-commitlint:** add VS16 to single character emojis ([#​4666](conventional-changelog/commitlint#4666)) ([9e3e2d3](conventional-changelog/commitlint@9e3e2d3)) - **cz-commitlint:** handle modifiers correctly ([#​4667](conventional-changelog/commitlint#4667)) ([5a3ebf5](conventional-changelog/commitlint@5a3ebf5)) - update dependency global-directory to v5 ([#​4671](conventional-changelog/commitlint#4671)) ([a300d32](conventional-changelog/commitlint@a300d32)) ##### Reverts - Revert "fix: update dependency global-directory to v5 ([#​4671](conventional-changelog/commitlint#4671))" ([#​4677](conventional-changelog/commitlint#4677)) ([0f124c9](conventional-changelog/commitlint@0f124c9)), closes [#​4671](conventional-changelog/commitlint#4671) [#​4677](conventional-changelog/commitlint#4677) </details> --- ### Configuration 📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC), Automerge - Between 12:00 AM and 03:59 AM ( * 0-3 * * * ) (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4zMS4wIiwidXBkYXRlZEluVmVyIjoiNDMuMzEuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Co-authored-by: devxy-bot <no-reply@devxy.io> Reviewed-on: https://codefloe.com/devxy/starlight-theme-celestia/pulls/16
Description
Single character emojis like 🛠 or 🗑 do not align with 2 character emojis in the rendered menu.
This adds character VS16 to single column width emojis to align them with 2 column width emojis.
Motivation and Context
Usage examples
How Has This Been Tested?
Added unit tests and used the local version to create the new Usage example.
Types of changes
Checklist: