Skip typecheck for emoji-datasource

This commit is contained in:
Fedor Indutny 2024-08-14 16:58:01 -07:00 committed by GitHub
parent 2c0ccb2e36
commit 3914216f5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 30 additions and 11 deletions

View file

@ -3,7 +3,6 @@
// Camelcase disabled due to emoji-datasource using snake_case
/* eslint-disable camelcase */
import untypedData from 'emoji-datasource';
import emojiRegex from 'emoji-regex';
import {
compact,
@ -25,6 +24,10 @@ import { MINUTE } from '../../util/durations';
import { drop } from '../../util/drop';
import type { LocaleEmojiType } from '../../types/emoji';
// Import emoji-datasource dynamically to avoid costly typechecking.
// eslint-disable-next-line import/no-dynamic-require, @typescript-eslint/no-var-requires
const untypedData = require('emoji-datasource' as string);
export const skinTones = ['1F3FB', '1F3FC', '1F3FD', '1F3FE', '1F3FF'];
export type SkinToneKey = '1F3FB' | '1F3FC' | '1F3FD' | '1F3FE' | '1F3FF';
@ -78,7 +81,7 @@ export type EmojiData = {
};
};
const data = (untypedData as Array<EmojiData>)
export const data = (untypedData as Array<EmojiData>)
.filter(emoji => emoji.has_img_apple)
.map(emoji =>
// Why this weird map?