[build] upgrade eslint to 9.37.0 (#88)

Co-authored-by: tobi <tobi.smethurst@protonmail.com>
Reviewed-on: https://codeberg.org/superseriousbusiness/masto-fe-standalone/pulls/88
Co-authored-by: Zoë Bijl <moiety@noreply.codeberg.org>
Co-committed-by: Zoë Bijl <moiety@noreply.codeberg.org>
This commit is contained in:
Zoë Bijl
2025-10-12 13:42:02 +02:00
committed by tobi
parent 75d7a62693
commit 1ff70886a1
975 changed files with 22196 additions and 21964 deletions
@@ -1,8 +1,8 @@
import escapeTextContentForBrowser from 'escape-html';
import escapeTextContentForBrowser from "escape-html";
import emojify from '../../features/emoji/emoji';
import { expandSpoilers } from '../../initial_state';
import { unescapeHTML } from '../../utils/html';
import emojify from "../../features/emoji/emoji";
import { expandSpoilers } from "../../initial_state";
import { unescapeHTML } from "../../utils/html";
const domParser = new DOMParser();
@@ -12,9 +12,9 @@ const makeEmojiMap = emojis => emojis.reduce((obj, emoji) => {
}, {});
export function searchTextFromRawStatus (status) {
const spoilerText = status.spoiler_text || '';
const searchContent = ([spoilerText, status.content].concat((status.poll && status.poll.options) ? status.poll.options.map(option => option.title) : [])).concat(status.media_attachments.map(att => att.description)).join('\n\n').replace(/<br\s*\/?>/g, '\n').replace(/<\/p><p>/g, '\n\n');
return domParser.parseFromString(searchContent, 'text/html').documentElement.textContent;
const spoilerText = status.spoiler_text || "";
const searchContent = ([spoilerText, status.content].concat((status.poll && status.poll.options) ? status.poll.options.map(option => option.title) : [])).concat(status.media_attachments.map(att => att.description)).join("\n\n").replace(/<br\s*\/?>/g, "\n").replace(/<\/p><p>/g, "\n\n");
return domParser.parseFromString(searchContent, "text/html").documentElement.textContent;
}
export function normalizeAccount(account) {
@@ -70,41 +70,41 @@ export function normalizeStatus(status, normalOldStatus) {
// Only calculate these values when status first encountered and
// when the underlying values change. Otherwise keep the ones
// already in the reducer
if (normalOldStatus && normalOldStatus.get('content') === normalStatus.content && normalOldStatus.get('spoiler_text') === normalStatus.spoiler_text) {
normalStatus.search_index = normalOldStatus.get('search_index');
normalStatus.contentHtml = normalOldStatus.get('contentHtml');
normalStatus.spoilerHtml = normalOldStatus.get('spoilerHtml');
normalStatus.spoiler_text = normalOldStatus.get('spoiler_text');
normalStatus.hidden = normalOldStatus.get('hidden');
if (normalOldStatus && normalOldStatus.get("content") === normalStatus.content && normalOldStatus.get("spoiler_text") === normalStatus.spoiler_text) {
normalStatus.search_index = normalOldStatus.get("search_index");
normalStatus.contentHtml = normalOldStatus.get("contentHtml");
normalStatus.spoilerHtml = normalOldStatus.get("spoilerHtml");
normalStatus.spoiler_text = normalOldStatus.get("spoiler_text");
normalStatus.hidden = normalOldStatus.get("hidden");
if (normalOldStatus.get('translation')) {
normalStatus.translation = normalOldStatus.get('translation');
if (normalOldStatus.get("translation")) {
normalStatus.translation = normalOldStatus.get("translation");
}
} else {
// If the status has a CW but no contents, treat the CW as if it were the
// status' contents, to avoid having a CW toggle with seemingly no effect.
if (normalStatus.spoiler_text && !normalStatus.content) {
normalStatus.content = normalStatus.spoiler_text;
normalStatus.spoiler_text = '';
normalStatus.spoiler_text = "";
}
const spoilerText = normalStatus.spoiler_text || '';
const searchContent = ([spoilerText, status.content].concat((status.poll && status.poll.options) ? status.poll.options.map(option => option.title) : [])).concat(status.media_attachments.map(att => att.description)).join('\n\n').replace(/<br\s*\/?>/g, '\n').replace(/<\/p><p>/g, '\n\n');
const spoilerText = normalStatus.spoiler_text || "";
const searchContent = ([spoilerText, status.content].concat((status.poll && status.poll.options) ? status.poll.options.map(option => option.title) : [])).concat(status.media_attachments.map(att => att.description)).join("\n\n").replace(/<br\s*\/?>/g, "\n").replace(/<\/p><p>/g, "\n\n");
const emojiMap = makeEmojiMap(normalStatus.emojis);
normalStatus.search_index = domParser.parseFromString(searchContent, 'text/html').documentElement.textContent;
normalStatus.search_index = domParser.parseFromString(searchContent, "text/html").documentElement.textContent;
normalStatus.contentHtml = emojify(normalStatus.content, emojiMap);
normalStatus.spoilerHtml = emojify(escapeTextContentForBrowser(spoilerText), emojiMap);
normalStatus.hidden = expandSpoilers ? false : spoilerText.length > 0 || normalStatus.sensitive;
}
if (normalOldStatus) {
const list = normalOldStatus.get('media_attachments');
const list = normalOldStatus.get("media_attachments");
if (normalStatus.media_attachments && list) {
normalStatus.media_attachments.forEach(item => {
const oldItem = list.find(i => i.get('id') === item.id);
if (oldItem && oldItem.get('description') === item.description) {
item.translation = oldItem.get('translation');
const oldItem = list.find(i => i.get("id") === item.id);
if (oldItem && oldItem.get("description") === item.description) {
item.translation = oldItem.get("translation");
}
});
}
@@ -114,7 +114,7 @@ export function normalizeStatus(status, normalOldStatus) {
}
export function normalizeStatusTranslation(translation, status) {
const emojiMap = makeEmojiMap(status.get('emojis').toJS());
const emojiMap = makeEmojiMap(status.get("emojis").toJS());
const normalTranslation = {
detected_source_language: translation.detected_source_language,
@@ -139,8 +139,8 @@ export function normalizePoll(poll, normalOldPoll) {
titleHtml: emojify(escapeTextContentForBrowser(option.title), emojiMap),
};
if (normalOldPoll && normalOldPoll.getIn(['options', index, 'title']) === option.title) {
normalOption.translation = normalOldPoll.getIn(['options', index, 'translation']);
if (normalOldPoll && normalOldPoll.getIn(["options", index, "title"]) === option.title) {
normalOption.translation = normalOldPoll.getIn(["options", index, "translation"]);
}
return normalOption;
@@ -150,7 +150,7 @@ export function normalizePoll(poll, normalOldPoll) {
}
export function normalizePollOptionTranslation(translation, poll) {
const emojiMap = makeEmojiMap(poll.get('emojis').toJS());
const emojiMap = makeEmojiMap(poll.get("emojis").toJS());
const normalTranslation = {
...translation,