diff --git a/app/javascript/flavours/glitch/components/counters.tsx b/app/javascript/flavours/glitch/components/counters.tsx index 35b0ad8d60..151b25a3f7 100644 --- a/app/javascript/flavours/glitch/components/counters.tsx +++ b/app/javascript/flavours/glitch/components/counters.tsx @@ -1,4 +1,4 @@ -import React from 'react'; +import type React from 'react'; import { FormattedMessage } from 'react-intl'; diff --git a/app/javascript/flavours/glitch/components/router.tsx b/app/javascript/flavours/glitch/components/router.tsx index 46477b96ff..0175e1b44f 100644 --- a/app/javascript/flavours/glitch/components/router.tsx +++ b/app/javascript/flavours/glitch/components/router.tsx @@ -1,5 +1,5 @@ import type { PropsWithChildren } from 'react'; -import React from 'react'; +import type React from 'react'; import { Router as OriginalRouter, useHistory } from 'react-router'; diff --git a/app/javascript/flavours/glitch/entrypoints/public.tsx b/app/javascript/flavours/glitch/entrypoints/public.tsx index e22e2cc85f..279a16ef57 100644 --- a/app/javascript/flavours/glitch/entrypoints/public.tsx +++ b/app/javascript/flavours/glitch/entrypoints/public.tsx @@ -68,7 +68,7 @@ function loaded() { if (id) message = localeData[id]; - if (!message) message = defaultMessage as string; + message ??= defaultMessage as string; const messageFormat = new IntlMessageFormat(message, locale); return messageFormat.format(values) as string; diff --git a/app/javascript/flavours/glitch/features/emoji/emoji_compressed.js b/app/javascript/flavours/glitch/features/emoji/emoji_compressed.js index 5bc70b209c..58f9bedbb8 100644 --- a/app/javascript/flavours/glitch/features/emoji/emoji_compressed.js +++ b/app/javascript/flavours/glitch/features/emoji/emoji_compressed.js @@ -1,5 +1,3 @@ -/* eslint-disable import/no-commonjs -- - We need to use CommonJS here due to preval */ // @preval // http://www.unicode.org/Public/emoji/5.0/emoji-test.txt // This file contains the compressed version of the emoji data from diff --git a/app/javascript/flavours/glitch/features/emoji/emoji_unicode_mapping_light.ts b/app/javascript/flavours/glitch/features/emoji/emoji_unicode_mapping_light.ts index adf4e2bb7b..0a5a4c1d76 100644 --- a/app/javascript/flavours/glitch/features/emoji/emoji_unicode_mapping_light.ts +++ b/app/javascript/flavours/glitch/features/emoji/emoji_unicode_mapping_light.ts @@ -33,11 +33,8 @@ function processEmojiMapData( shortCode?: ShortCodesToEmojiDataKey, ) { const [native, _filename] = emojiMapData; - let filename = emojiMapData[1]; - if (!filename) { - // filename name can be derived from unicodeToFilename - filename = unicodeToFilename(native); - } + // filename name can be derived from unicodeToFilename + const filename = emojiMapData[1] ?? unicodeToFilename(native); unicodeMapping[native] = { shortCode, filename, diff --git a/app/javascript/flavours/glitch/features/emoji/unicode_to_filename.js b/app/javascript/flavours/glitch/features/emoji/unicode_to_filename.js index 3395c77174..c75c4cd7d0 100644 --- a/app/javascript/flavours/glitch/features/emoji/unicode_to_filename.js +++ b/app/javascript/flavours/glitch/features/emoji/unicode_to_filename.js @@ -1,6 +1,3 @@ -/* eslint-disable import/no-commonjs -- - We need to use CommonJS here as its imported into a preval file (`emoji_compressed.js`) */ - // taken from: // https://github.com/twitter/twemoji/blob/47732c7/twemoji-generator.js#L848-L866 exports.unicodeToFilename = (str) => { diff --git a/app/javascript/flavours/glitch/features/emoji/unicode_to_unified_name.js b/app/javascript/flavours/glitch/features/emoji/unicode_to_unified_name.js index 108b911222..d29550f122 100644 --- a/app/javascript/flavours/glitch/features/emoji/unicode_to_unified_name.js +++ b/app/javascript/flavours/glitch/features/emoji/unicode_to_unified_name.js @@ -1,6 +1,3 @@ -/* eslint-disable import/no-commonjs -- - We need to use CommonJS here as its imported into a preval file (`emoji_compressed.js`) */ - function padLeft(str, num) { while (str.length < num) { str = '0' + str; diff --git a/app/javascript/flavours/glitch/features/status/components/detailed_status.tsx b/app/javascript/flavours/glitch/features/status/components/detailed_status.tsx index 2b15d7b50b..f2817f03b7 100644 --- a/app/javascript/flavours/glitch/features/status/components/detailed_status.tsx +++ b/app/javascript/flavours/glitch/features/status/components/detailed_status.tsx @@ -4,7 +4,7 @@ @typescript-eslint/no-unsafe-assignment */ import type { CSSProperties } from 'react'; -import React, { useState, useRef, useCallback } from 'react'; +import { useState, useRef, useCallback } from 'react'; import { FormattedMessage } from 'react-intl';