[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,38 +1,38 @@
import PropTypes from 'prop-types';
import PropTypes from "prop-types";
import { FormattedMessage, injectIntl, defineMessages } from 'react-intl';
import { FormattedMessage, injectIntl, defineMessages } from "react-intl";
import classNames from 'classnames';
import { Link } from 'react-router-dom';
import classNames from "classnames";
import { Link } from "react-router-dom";
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { connect } from 'react-redux';
import ImmutablePropTypes from "react-immutable-proptypes";
import ImmutablePureComponent from "react-immutable-pure-component";
import { connect } from "react-redux";
import {
followAccount,
unfollowAccount,
unblockAccount,
unmuteAccount,
} from 'mastodon/actions/accounts';
import { openModal } from 'mastodon/actions/modal';
import { Avatar } from 'mastodon/components/avatar';
import Button from 'mastodon/components/button';
import { DisplayName } from 'mastodon/components/display_name';
import { ShortNumber } from 'mastodon/components/short_number';
import { autoPlayGif, me, unfollowModal } from 'mastodon/initial_state';
import { makeGetAccount } from 'mastodon/selectors';
} from "mastodon/actions/accounts";
import { openModal } from "mastodon/actions/modal";
import { Avatar } from "mastodon/components/avatar";
import Button from "mastodon/components/button";
import { DisplayName } from "mastodon/components/display_name";
import { ShortNumber } from "mastodon/components/short_number";
import { autoPlayGif, me, unfollowModal } from "mastodon/initial_state";
import { makeGetAccount } from "mastodon/selectors";
const messages = defineMessages({
unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' },
follow: { id: 'account.follow', defaultMessage: 'Follow' },
cancel_follow_request: { id: 'account.cancel_follow_request', defaultMessage: 'Withdraw follow request' },
cancelFollowRequestConfirm: { id: 'confirmations.cancel_follow_request.confirm', defaultMessage: 'Withdraw request' },
requested: { id: 'account.requested', defaultMessage: 'Awaiting approval. Click to cancel follow request' },
unblock: { id: 'account.unblock_short', defaultMessage: 'Unblock' },
unmute: { id: 'account.unmute_short', defaultMessage: 'Unmute' },
unfollowConfirm: { id: 'confirmations.unfollow.confirm', defaultMessage: 'Unfollow' },
edit_profile: { id: 'account.edit_profile', defaultMessage: 'Edit profile' },
unfollow: { id: "account.unfollow", defaultMessage: "Unfollow" },
follow: { id: "account.follow", defaultMessage: "Follow" },
cancel_follow_request: { id: "account.cancel_follow_request", defaultMessage: "Withdraw follow request" },
cancelFollowRequestConfirm: { id: "confirmations.cancel_follow_request.confirm", defaultMessage: "Withdraw request" },
requested: { id: "account.requested", defaultMessage: "Awaiting approval. Click to cancel follow request" },
unblock: { id: "account.unblock_short", defaultMessage: "Unblock" },
unmute: { id: "account.unmute_short", defaultMessage: "Unmute" },
unfollowConfirm: { id: "confirmations.unfollow.confirm", defaultMessage: "Unfollow" },
edit_profile: { id: "account.edit_profile", defaultMessage: "Edit profile" },
});
const makeMapStateToProps = () => {
@@ -47,53 +47,53 @@ const makeMapStateToProps = () => {
const mapDispatchToProps = (dispatch, { intl }) => ({
onFollow(account) {
if (account.getIn(['relationship', 'following'])) {
if (account.getIn(["relationship", "following"])) {
if (unfollowModal) {
dispatch(
openModal({
modalType: 'CONFIRM',
modalType: "CONFIRM",
modalProps: {
message: (
<FormattedMessage
id='confirmations.unfollow.message'
defaultMessage='Are you sure you want to unfollow {name}?'
values={{ name: <strong>@{account.get('acct')}</strong> }}
values={{ name: <strong>@{account.get("acct")}</strong> }}
/>
),
confirm: intl.formatMessage(messages.unfollowConfirm),
onConfirm: () => dispatch(unfollowAccount(account.get('id'))),
onConfirm: () => dispatch(unfollowAccount(account.get("id"))),
} }),
);
} else {
dispatch(unfollowAccount(account.get('id')));
dispatch(unfollowAccount(account.get("id")));
}
} else if (account.getIn(['relationship', 'requested'])) {
} else if (account.getIn(["relationship", "requested"])) {
if (unfollowModal) {
dispatch(openModal({
modalType: 'CONFIRM',
modalType: "CONFIRM",
modalProps: {
message: <FormattedMessage id='confirmations.cancel_follow_request.message' defaultMessage='Are you sure you want to withdraw your request to follow {name}?' values={{ name: <strong>@{account.get('acct')}</strong> }} />,
message: <FormattedMessage id='confirmations.cancel_follow_request.message' defaultMessage='Are you sure you want to withdraw your request to follow {name}?' values={{ name: <strong>@{account.get("acct")}</strong> }} />,
confirm: intl.formatMessage(messages.cancelFollowRequestConfirm),
onConfirm: () => dispatch(unfollowAccount(account.get('id'))),
onConfirm: () => dispatch(unfollowAccount(account.get("id"))),
},
}));
} else {
dispatch(unfollowAccount(account.get('id')));
dispatch(unfollowAccount(account.get("id")));
}
} else {
dispatch(followAccount(account.get('id')));
dispatch(followAccount(account.get("id")));
}
},
onBlock(account) {
if (account.getIn(['relationship', 'blocking'])) {
dispatch(unblockAccount(account.get('id')));
if (account.getIn(["relationship", "blocking"])) {
dispatch(unblockAccount(account.get("id")));
}
},
onMute(account) {
if (account.getIn(['relationship', 'muting'])) {
dispatch(unmuteAccount(account.get('id')));
if (account.getIn(["relationship", "muting"])) {
dispatch(unmuteAccount(account.get("id")));
}
},
@@ -114,11 +114,11 @@ class AccountCard extends ImmutablePureComponent {
return;
}
const emojis = currentTarget.querySelectorAll('.custom-emoji');
const emojis = currentTarget.querySelectorAll(".custom-emoji");
for (var i = 0; i < emojis.length; i++) {
let emoji = emojis[i];
emoji.src = emoji.getAttribute('data-original');
emoji.src = emoji.getAttribute("data-original");
}
};
@@ -127,11 +127,11 @@ class AccountCard extends ImmutablePureComponent {
return;
}
const emojis = currentTarget.querySelectorAll('.custom-emoji');
const emojis = currentTarget.querySelectorAll(".custom-emoji");
for (var i = 0; i < emojis.length; i++) {
let emoji = emojis[i];
emoji.src = emoji.getAttribute('data-static');
emoji.src = emoji.getAttribute("data-static");
}
};
@@ -148,7 +148,7 @@ class AccountCard extends ImmutablePureComponent {
};
handleEditProfile = () => {
window.open('/settings/profile', '_blank');
window.open("/settings/profile", "_blank");
};
render() {
@@ -156,16 +156,16 @@ class AccountCard extends ImmutablePureComponent {
let actionBtn;
if (me !== account.get('id')) {
if (!account.get('relationship')) { // Wait until the relationship is loaded
actionBtn = '';
} else if (account.getIn(['relationship', 'requested'])) {
if (me !== account.get("id")) {
if (!account.get("relationship")) { // Wait until the relationship is loaded
actionBtn = "";
} else if (account.getIn(["relationship", "requested"])) {
actionBtn = <Button text={intl.formatMessage(messages.cancel_follow_request)} title={intl.formatMessage(messages.requested)} onClick={this.handleFollow} />;
} else if (account.getIn(['relationship', 'muting'])) {
} else if (account.getIn(["relationship", "muting"])) {
actionBtn = <Button text={intl.formatMessage(messages.unmute)} onClick={this.handleMute} />;
} else if (!account.getIn(['relationship', 'blocking'])) {
actionBtn = <Button disabled={account.getIn(['relationship', 'blocked_by'])} className={classNames({ 'button--destructive': account.getIn(['relationship', 'following']) })} text={intl.formatMessage(account.getIn(['relationship', 'following']) ? messages.unfollow : messages.follow)} onClick={this.handleFollow} />;
} else if (account.getIn(['relationship', 'blocking'])) {
} else if (!account.getIn(["relationship", "blocking"])) {
actionBtn = <Button disabled={account.getIn(["relationship", "blocked_by"])} className={classNames({ "button--destructive": account.getIn(["relationship", "following"]) })} text={intl.formatMessage(account.getIn(["relationship", "following"]) ? messages.unfollow : messages.follow)} onClick={this.handleFollow} />;
} else if (account.getIn(["relationship", "blocking"])) {
actionBtn = <Button text={intl.formatMessage(messages.unblock)} onClick={this.handleBlock} />;
}
} else {
@@ -174,11 +174,11 @@ class AccountCard extends ImmutablePureComponent {
return (
<div className='account-card'>
<Link to={`/@${account.get('acct')}`} className='account-card__permalink'>
<Link to={`/@${account.get("acct")}`} className='account-card__permalink'>
<div className='account-card__header'>
<img
src={
autoPlayGif ? account.get('header') : account.get('header_static')
autoPlayGif ? account.get("header") : account.get("header_static")
}
alt=''
/>
@@ -190,26 +190,26 @@ class AccountCard extends ImmutablePureComponent {
</div>
</Link>
{account.get('note').length > 0 && (
{account.get("note").length > 0 && (
<div
className='account-card__bio translate'
onMouseEnter={this.handleMouseEnter}
onMouseLeave={this.handleMouseLeave}
dangerouslySetInnerHTML={{ __html: account.get('note_emojified') }}
dangerouslySetInnerHTML={{ __html: account.get("note_emojified") }}
/>
)}
<div className='account-card__actions'>
<div className='account-card__counters'>
<div className='account-card__counters__item'>
<ShortNumber value={account.get('statuses_count')} />
<ShortNumber value={account.get("statuses_count")} />
<small>
<FormattedMessage id='account.posts' defaultMessage='Posts' />
</small>
</div>
<div className='account-card__counters__item'>
<ShortNumber value={account.get('followers_count')} />{' '}
<ShortNumber value={account.get("followers_count")} />{" "}
<small>
<FormattedMessage
id='account.followers'
@@ -219,7 +219,7 @@ class AccountCard extends ImmutablePureComponent {
</div>
<div className='account-card__counters__item'>
<ShortNumber value={account.get('following_count')} />{' '}
<ShortNumber value={account.get("following_count")} />{" "}
<small>
<FormattedMessage
id='account.following'
@@ -1,37 +1,37 @@
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import PropTypes from "prop-types";
import { PureComponent } from "react";
import { defineMessages, injectIntl } from 'react-intl';
import { defineMessages, injectIntl } from "react-intl";
import { Helmet } from 'react-helmet';
import { Helmet } from "react-helmet";
import { List as ImmutableList } from 'immutable';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';
import { List as ImmutableList } from "immutable";
import ImmutablePropTypes from "react-immutable-proptypes";
import { connect } from "react-redux";
import { addColumn, removeColumn, moveColumn, changeColumnParams } from 'mastodon/actions/columns';
import { fetchDirectory, expandDirectory } from 'mastodon/actions/directory';
import Column from 'mastodon/components/column';
import ColumnHeader from 'mastodon/components/column_header';
import { LoadMore } from 'mastodon/components/load_more';
import { LoadingIndicator } from 'mastodon/components/loading_indicator';
import { RadioButton } from 'mastodon/components/radio_button';
import ScrollContainer from 'mastodon/containers/scroll_container';
import { addColumn, removeColumn, moveColumn, changeColumnParams } from "mastodon/actions/columns";
import { fetchDirectory, expandDirectory } from "mastodon/actions/directory";
import Column from "mastodon/components/column";
import ColumnHeader from "mastodon/components/column_header";
import { LoadMore } from "mastodon/components/load_more";
import { LoadingIndicator } from "mastodon/components/loading_indicator";
import { RadioButton } from "mastodon/components/radio_button";
import ScrollContainer from "mastodon/containers/scroll_container";
import AccountCard from './components/account_card';
import AccountCard from "./components/account_card";
const messages = defineMessages({
title: { id: 'column.directory', defaultMessage: 'Browse profiles' },
recentlyActive: { id: 'directory.recently_active', defaultMessage: 'Recently active' },
newArrivals: { id: 'directory.new_arrivals', defaultMessage: 'New arrivals' },
local: { id: 'directory.local', defaultMessage: 'From {domain} only' },
federated: { id: 'directory.federated', defaultMessage: 'From known fediverse' },
title: { id: "column.directory", defaultMessage: "Browse profiles" },
recentlyActive: { id: "directory.recently_active", defaultMessage: "Recently active" },
newArrivals: { id: "directory.new_arrivals", defaultMessage: "New arrivals" },
local: { id: "directory.local", defaultMessage: "From {domain} only" },
federated: { id: "directory.federated", defaultMessage: "From known fediverse" },
});
const mapStateToProps = state => ({
accountIds: state.getIn(['user_lists', 'directory', 'items'], ImmutableList()),
isLoading: state.getIn(['user_lists', 'directory', 'isLoading'], true),
domain: state.getIn(['meta', 'domain']),
accountIds: state.getIn(["user_lists", "directory", "items"], ImmutableList()),
isLoading: state.getIn(["user_lists", "directory", "isLoading"], true),
domain: state.getIn(["meta", "domain"]),
});
class Directory extends PureComponent {
@@ -65,12 +65,12 @@ class Directory extends PureComponent {
if (columnId) {
dispatch(removeColumn(columnId));
} else {
dispatch(addColumn('DIRECTORY', this.getParams(this.props, this.state)));
dispatch(addColumn("DIRECTORY", this.getParams(this.props, this.state)));
}
};
getParams = (props, state) => ({
order: state.order === null ? (props.params.order || 'active') : state.order,
order: state.order === null ? (props.params.order || "active") : state.order,
local: state.local === null ? (props.params.local || false) : state.local,
});
@@ -106,7 +106,7 @@ class Directory extends PureComponent {
const { dispatch, columnId } = this.props;
if (columnId) {
dispatch(changeColumnParams(columnId, ['order'], e.target.value));
dispatch(changeColumnParams(columnId, ["order"], e.target.value));
} else {
this.setState({ order: e.target.value });
}
@@ -116,9 +116,9 @@ class Directory extends PureComponent {
const { dispatch, columnId } = this.props;
if (columnId) {
dispatch(changeColumnParams(columnId, ['local'], e.target.value === '1'));
dispatch(changeColumnParams(columnId, ["local"], e.target.value === "1"));
} else {
this.setState({ local: e.target.value === '1' });
this.setState({ local: e.target.value === "1" });
}
};
@@ -136,8 +136,8 @@ class Directory extends PureComponent {
<div className='scrollable'>
<div className='filter-form'>
<div className='filter-form__column' role='group'>
<RadioButton name='order' value='active' label={intl.formatMessage(messages.recentlyActive)} checked={order === 'active'} onChange={this.handleChangeOrder} />
<RadioButton name='order' value='new' label={intl.formatMessage(messages.newArrivals)} checked={order === 'new'} onChange={this.handleChangeOrder} />
<RadioButton name='order' value='active' label={intl.formatMessage(messages.recentlyActive)} checked={order === "active"} onChange={this.handleChangeOrder} />
<RadioButton name='order' value='new' label={intl.formatMessage(messages.newArrivals)} checked={order === "new"} onChange={this.handleChangeOrder} />
</div>
<div className='filter-form__column' role='group'>