[Glitch] Upgrade to ESLint v9 flat config

Port e8270e2807 to glitch-soc

Co-authored-by: Nick Schonning <nschonni@gmail.com>
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Echo
2025-04-01 18:30:18 +02:00
committed by Claire
parent e0406fcf02
commit 07d1625786
8 changed files with 6 additions and 17 deletions

View File

@@ -1,4 +1,4 @@
import React from 'react'; import type React from 'react';
import { FormattedMessage } from 'react-intl'; import { FormattedMessage } from 'react-intl';

View File

@@ -1,5 +1,5 @@
import type { PropsWithChildren } from 'react'; import type { PropsWithChildren } from 'react';
import React from 'react'; import type React from 'react';
import { Router as OriginalRouter, useHistory } from 'react-router'; import { Router as OriginalRouter, useHistory } from 'react-router';

View File

@@ -68,7 +68,7 @@ function loaded() {
if (id) message = localeData[id]; if (id) message = localeData[id];
if (!message) message = defaultMessage as string; message ??= defaultMessage as string;
const messageFormat = new IntlMessageFormat(message, locale); const messageFormat = new IntlMessageFormat(message, locale);
return messageFormat.format(values) as string; return messageFormat.format(values) as string;

View File

@@ -1,5 +1,3 @@
/* eslint-disable import/no-commonjs --
We need to use CommonJS here due to preval */
// @preval // @preval
// http://www.unicode.org/Public/emoji/5.0/emoji-test.txt // http://www.unicode.org/Public/emoji/5.0/emoji-test.txt
// This file contains the compressed version of the emoji data from // This file contains the compressed version of the emoji data from

View File

@@ -33,11 +33,8 @@ function processEmojiMapData(
shortCode?: ShortCodesToEmojiDataKey, shortCode?: ShortCodesToEmojiDataKey,
) { ) {
const [native, _filename] = emojiMapData; const [native, _filename] = emojiMapData;
let filename = emojiMapData[1]; // filename name can be derived from unicodeToFilename
if (!filename) { const filename = emojiMapData[1] ?? unicodeToFilename(native);
// filename name can be derived from unicodeToFilename
filename = unicodeToFilename(native);
}
unicodeMapping[native] = { unicodeMapping[native] = {
shortCode, shortCode,
filename, filename,

View File

@@ -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: // taken from:
// https://github.com/twitter/twemoji/blob/47732c7/twemoji-generator.js#L848-L866 // https://github.com/twitter/twemoji/blob/47732c7/twemoji-generator.js#L848-L866
exports.unicodeToFilename = (str) => { exports.unicodeToFilename = (str) => {

View File

@@ -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) { function padLeft(str, num) {
while (str.length < num) { while (str.length < num) {
str = '0' + str; str = '0' + str;

View File

@@ -4,7 +4,7 @@
@typescript-eslint/no-unsafe-assignment */ @typescript-eslint/no-unsafe-assignment */
import type { CSSProperties } from 'react'; import type { CSSProperties } from 'react';
import React, { useState, useRef, useCallback } from 'react'; import { useState, useRef, useCallback } from 'react';
import { FormattedMessage } from 'react-intl'; import { FormattedMessage } from 'react-intl';