mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-21 14:18:36 +00:00
[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:
@@ -1,4 +1,4 @@
|
|||||||
import React from 'react';
|
import type React from 'react';
|
||||||
|
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
|
||||||
|
|||||||
@@ -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';
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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) => {
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user