From 8c20872ee28f42c27bf698df3558860c9e3ca464 Mon Sep 17 00:00:00 2001
From: Michael Kriese <michael.kriese@visualon.de>
Date: Wed, 18 May 2022 11:32:27 +0200
Subject: [PATCH] fix(config): `unicodeEmoji` is a global only option (#15631)

---
 docs/usage/configuration-options.md            | 4 ----
 docs/usage/self-hosted-configuration.md        | 4 ++++
 lib/config/options/index.ts                    | 1 +
 lib/modules/platform/bitbucket-server/index.md | 2 +-
 lib/util/emoji.ts                              | 4 ++--
 5 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/docs/usage/configuration-options.md b/docs/usage/configuration-options.md
index d1f182281e..120c845f10 100644
--- a/docs/usage/configuration-options.md
+++ b/docs/usage/configuration-options.md
@@ -2695,10 +2695,6 @@ When the `lockfileVersion` is higher than `1` in `package-lock.json`, remediatio
 
 This is considered a feature flag with the aim to remove it and default to this behavior once it has been more widely tested.
 
-## unicodeEmoji
-
-If enabled emoji shortcodes (`:warning:`) are replaced with their Unicode equivalents (`⚠️`).
-
 ## updateInternalDeps
 
 Renovate defaults to skipping any internal package dependencies within monorepos.
diff --git a/docs/usage/self-hosted-configuration.md b/docs/usage/self-hosted-configuration.md
index 774ee0d514..a130e7d185 100644
--- a/docs/usage/self-hosted-configuration.md
+++ b/docs/usage/self-hosted-configuration.md
@@ -665,6 +665,10 @@ This is currently applicable to `npm` and `lerna`/`npm` only, and only used in c
 
 ## token
 
+## unicodeEmoji
+
+If enabled emoji shortcodes (`:warning:`) are replaced with their Unicode equivalents (`⚠️`).
+
 ## username
 
 You might need to set a `username` if you use:
diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts
index 9f678babef..3253e6e237 100644
--- a/lib/config/options/index.ts
+++ b/lib/config/options/index.ts
@@ -2094,6 +2094,7 @@ const options: RenovateOptions[] = [
     description: 'Enable or disable Unicode emoji.',
     type: 'boolean',
     default: true,
+    globalOnly: true,
   },
   {
     name: 'gitLabIgnoreApprovals',
diff --git a/lib/modules/platform/bitbucket-server/index.md b/lib/modules/platform/bitbucket-server/index.md
index ea768b8a3b..75fcbb6687 100644
--- a/lib/modules/platform/bitbucket-server/index.md
+++ b/lib/modules/platform/bitbucket-server/index.md
@@ -13,7 +13,7 @@ Remember to set `platform=bitbucket-server` somewhere in your Renovate config fi
 
 If you're not using `@renovate-bot` as username then set your custom `username` for the bot account.
 
-If you use MySQL or MariaDB you must set `unicodeEmoji` to `false` in the bot config (`RENOVATE_CONFIG_FILE`) to prevent issues with emojis.
+If you use MySQL or MariaDB you must set `unicodeEmoji` to `false` in the global bot config (`RENOVATE_CONFIG_FILE`) to prevent issues with emojis.
 
 ## Unsupported platform features/concepts
 
diff --git a/lib/util/emoji.ts b/lib/util/emoji.ts
index f5b9375afb..8d310db93a 100644
--- a/lib/util/emoji.ts
+++ b/lib/util/emoji.ts
@@ -33,8 +33,8 @@ function lazyInitMappings(): void {
   }
 }
 
-export function setEmojiConfig(_config: RenovateConfig): void {
-  unicodeEmoji = !!_config.unicodeEmoji;
+export function setEmojiConfig(config: RenovateConfig): void {
+  unicodeEmoji = !!config.unicodeEmoji;
 }
 
 const shortCodeRegex = regEx(SHORTCODE_REGEX.source, 'g');
-- 
GitLab