[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,33 +1,33 @@
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import PropTypes from "prop-types";
import { PureComponent } from "react";
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { defineMessages, injectIntl, FormattedMessage } from "react-intl";
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 Button from 'mastodon/components/button';
import Button from "mastodon/components/button";
import Option from './components/option';
import Option from "./components/option";
const messages = defineMessages({
dislike: { id: 'report.reasons.dislike', defaultMessage: 'I don\'t like it' },
dislike_description: { id: 'report.reasons.dislike_description', defaultMessage: 'It is not something you want to see' },
spam: { id: 'report.reasons.spam', defaultMessage: 'It\'s spam' },
spam_description: { id: 'report.reasons.spam_description', defaultMessage: 'Malicious links, fake engagement, or repetitive replies' },
legal: { id: 'report.reasons.legal', defaultMessage: 'It\'s illegal' },
legal_description: { id: 'report.reasons.legal_description', defaultMessage: 'You believe it violates the law of your or the server\'s country' },
violation: { id: 'report.reasons.violation', defaultMessage: 'It violates server rules' },
violation_description: { id: 'report.reasons.violation_description', defaultMessage: 'You are aware that it breaks specific rules' },
other: { id: 'report.reasons.other', defaultMessage: 'It\'s something else' },
other_description: { id: 'report.reasons.other_description', defaultMessage: 'The issue does not fit into other categories' },
status: { id: 'report.category.title_status', defaultMessage: 'post' },
account: { id: 'report.category.title_account', defaultMessage: 'profile' },
dislike: { id: "report.reasons.dislike", defaultMessage: "I don't like it" },
dislike_description: { id: "report.reasons.dislike_description", defaultMessage: "It is not something you want to see" },
spam: { id: "report.reasons.spam", defaultMessage: "It's spam" },
spam_description: { id: "report.reasons.spam_description", defaultMessage: "Malicious links, fake engagement, or repetitive replies" },
legal: { id: "report.reasons.legal", defaultMessage: "It's illegal" },
legal_description: { id: "report.reasons.legal_description", defaultMessage: "You believe it violates the law of your or the server's country" },
violation: { id: "report.reasons.violation", defaultMessage: "It violates server rules" },
violation_description: { id: "report.reasons.violation_description", defaultMessage: "You are aware that it breaks specific rules" },
other: { id: "report.reasons.other", defaultMessage: "It's something else" },
other_description: { id: "report.reasons.other_description", defaultMessage: "The issue does not fit into other categories" },
status: { id: "report.category.title_status", defaultMessage: "post" },
account: { id: "report.category.title_account", defaultMessage: "profile" },
});
const mapStateToProps = state => ({
rules: state.getIn(['server', 'server', 'rules'], ImmutableList()),
rules: state.getIn(["server", "server", "rules"], ImmutableList()),
});
class Category extends PureComponent {
@@ -37,7 +37,7 @@ class Category extends PureComponent {
rules: ImmutablePropTypes.list,
category: PropTypes.string,
onChangeCategory: PropTypes.func.isRequired,
startedFrom: PropTypes.oneOf(['status', 'account']),
startedFrom: PropTypes.oneOf(["status", "account"]),
intl: PropTypes.object.isRequired,
};
@@ -45,15 +45,15 @@ class Category extends PureComponent {
const { onNextStep, category } = this.props;
switch(category) {
case 'dislike':
onNextStep('thanks');
break;
case 'violation':
onNextStep('rules');
break;
default:
onNextStep('statuses');
break;
case "dislike":
onNextStep("thanks");
break;
case "violation":
onNextStep("rules");
break;
default:
onNextStep("statuses");
break;
}
};
@@ -69,16 +69,16 @@ class Category extends PureComponent {
const { category, startedFrom, rules, intl } = this.props;
const options = rules.size > 0 ? [
'dislike',
'spam',
'legal',
'violation',
'other',
"dislike",
"spam",
"legal",
"violation",
"other",
] : [
'dislike',
'spam',
'legal',
'other',
"dislike",
"spam",
"legal",
"other",
];
return (
@@ -1,32 +1,32 @@
import PropTypes from 'prop-types';
import { useCallback, useEffect, useRef } from 'react';
import PropTypes from "prop-types";
import { useCallback, useEffect, useRef } from "react";
import { useIntl, defineMessages, FormattedMessage } from 'react-intl';
import { useIntl, defineMessages, FormattedMessage } from "react-intl";
import { OrderedSet, List as ImmutableList } from 'immutable';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { shallowEqual } from 'react-redux';
import { createSelector } from 'reselect';
import { OrderedSet, List as ImmutableList } from "immutable";
import ImmutablePropTypes from "react-immutable-proptypes";
import { shallowEqual } from "react-redux";
import { createSelector } from "reselect";
import Toggle from 'react-toggle';
import Toggle from "react-toggle";
import { fetchAccount } from 'mastodon/actions/accounts';
import Button from 'mastodon/components/button';
import { useAppDispatch, useAppSelector } from 'mastodon/store';
import { fetchAccount } from "mastodon/actions/accounts";
import Button from "mastodon/components/button";
import { useAppDispatch, useAppSelector } from "mastodon/store";
const messages = defineMessages({
placeholder: { id: 'report.placeholder', defaultMessage: 'Type or paste additional comments' },
placeholder: { id: "report.placeholder", defaultMessage: "Type or paste additional comments" },
});
const selectRepliedToAccountIds = createSelector(
[
(state) => state.get('statuses'),
(state) => state.get("statuses"),
(_, statusIds) => statusIds,
],
(statusesMap, statusIds) => statusIds.map((statusId) => statusesMap.getIn([statusId, 'in_reply_to_account_id'])),
(statusesMap, statusIds) => statusIds.map((statusId) => statusesMap.getIn([statusId, "in_reply_to_account_id"])),
{
resultEqualityCheck: shallowEqual,
}
},
);
const Comment = ({ comment, domain, statusIds, isRemote, isSubmitting, selectedDomains, onSubmit, onChangeComment, onToggleDomain }) => {
@@ -49,8 +49,8 @@ const Comment = ({ comment, domain, statusIds, isRemote, isSubmitting, selectedD
const accountIds = useAppSelector((state) => domain ? selectRepliedToAccountIds(state, statusIds) : ImmutableList());
// While we could memoize `availableDomains`, it is pretty inexpensive to recompute
const accountsMap = useAppSelector((state) => state.get('accounts'));
const availableDomains = domain ? OrderedSet([domain]).union(accountIds.map((accountId) => accountsMap.getIn([accountId, 'acct'], '').split('@')[1]).filter(domain => !!domain)) : OrderedSet();
const accountsMap = useAppSelector((state) => state.get("accounts"));
const availableDomains = domain ? OrderedSet([domain]).union(accountIds.map((accountId) => accountsMap.getIn([accountId, "acct"], "").split("@")[1]).filter(domain => !!domain)) : OrderedSet();
useEffect(() => {
if (loadedRef.current) {
@@ -1,9 +1,9 @@
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import PropTypes from "prop-types";
import { PureComponent } from "react";
import classNames from 'classnames';
import classNames from "classnames";
import { Check } from 'mastodon/components/check';
import { Check } from "mastodon/components/check";
export default class Option extends PureComponent {
@@ -21,7 +21,7 @@ export default class Option extends PureComponent {
handleKeyPress = e => {
const { value, checked, onToggle } = this.props;
if (e.key === 'Enter' || e.key === ' ') {
if (e.key === "Enter" || e.key === " ") {
e.stopPropagation();
e.preventDefault();
onToggle(value, !checked);
@@ -38,10 +38,10 @@ export default class Option extends PureComponent {
return (
<label className='dialog-option poll__option selectable'>
<input type={multiple ? 'checkbox' : 'radio'} name={name} value={value} checked={checked} onChange={this.handleChange} />
<input type={multiple ? "checkbox" : "radio"} name={name} value={value} checked={checked} onChange={this.handleChange} />
<span
className={classNames('poll__input', { active: checked, checkbox: multiple })}
className={classNames("poll__input", { active: checked, checkbox: multiple })}
tabIndex={0}
role='radio'
onKeyPress={this.handleKeyPress}
@@ -1,24 +1,24 @@
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import PropTypes from "prop-types";
import { PureComponent } from "react";
import { injectIntl, defineMessages } from 'react-intl';
import { injectIntl, defineMessages } from "react-intl";
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePropTypes from "react-immutable-proptypes";
import { Avatar } from 'mastodon/components/avatar';
import { DisplayName } from 'mastodon/components/display_name';
import { Icon } from 'mastodon/components/icon';
import MediaAttachments from 'mastodon/components/media_attachments';
import { RelativeTimestamp } from 'mastodon/components/relative_timestamp';
import StatusContent from 'mastodon/components/status_content';
import { Avatar } from "mastodon/components/avatar";
import { DisplayName } from "mastodon/components/display_name";
import { Icon } from "mastodon/components/icon";
import MediaAttachments from "mastodon/components/media_attachments";
import { RelativeTimestamp } from "mastodon/components/relative_timestamp";
import StatusContent from "mastodon/components/status_content";
import Option from './option';
import Option from "./option";
const messages = defineMessages({
public_short: { id: 'privacy.public.short', defaultMessage: 'Public' },
unlisted_short: { id: 'privacy.unlisted.short', defaultMessage: 'Unlisted' },
private_short: { id: 'privacy.private.short', defaultMessage: 'Followers only' },
direct_short: { id: 'privacy.direct.short', defaultMessage: 'Mentioned people only' },
public_short: { id: "privacy.public.short", defaultMessage: "Public" },
unlisted_short: { id: "privacy.unlisted.short", defaultMessage: "Unlisted" },
private_short: { id: "privacy.private.short", defaultMessage: "Followers only" },
direct_short: { id: "privacy.direct.short", defaultMessage: "Mentioned people only" },
});
class StatusCheckBox extends PureComponent {
@@ -39,28 +39,28 @@ class StatusCheckBox extends PureComponent {
render () {
const { status, checked, intl } = this.props;
if (status.get('reblog')) {
if (status.get("reblog")) {
return null;
}
const visibilityIconInfo = {
'public': { icon: 'globe', text: intl.formatMessage(messages.public_short) },
'unlisted': { icon: 'unlock', text: intl.formatMessage(messages.unlisted_short) },
'private': { icon: 'lock', text: intl.formatMessage(messages.private_short) },
'direct': { icon: 'at', text: intl.formatMessage(messages.direct_short) },
"public": { icon: "globe", text: intl.formatMessage(messages.public_short) },
"unlisted": { icon: "unlock", text: intl.formatMessage(messages.unlisted_short) },
"private": { icon: "lock", text: intl.formatMessage(messages.private_short) },
"direct": { icon: "at", text: intl.formatMessage(messages.direct_short) },
};
const visibilityIcon = visibilityIconInfo[status.get('visibility')];
const visibilityIcon = visibilityIconInfo[status.get("visibility")];
const labelComponent = (
<div className='status-check-box__status poll__option__text'>
<div className='detailed-status__display-name'>
<div className='detailed-status__display-avatar'>
<Avatar account={status.get('account')} size={46} />
<Avatar account={status.get("account")} size={46} />
</div>
<div>
<DisplayName account={status.get('account')} /> · <span className='status__visibility-icon'><Icon id={visibilityIcon.icon} title={visibilityIcon.text} /></span> <RelativeTimestamp timestamp={status.get('created_at')} />
<DisplayName account={status.get("account")} /> · <span className='status__visibility-icon'><Icon id={visibilityIcon.icon} title={visibilityIcon.text} /></span> <RelativeTimestamp timestamp={status.get("created_at")} />
</div>
</div>
@@ -72,10 +72,10 @@ class StatusCheckBox extends PureComponent {
return (
<Option
name='status_ids'
value={status.get('id')}
value={status.get("id")}
checked={checked}
onToggle={this.handleStatusesToggle}
label={status.get('search_index')}
label={status.get("search_index")}
labelComponent={labelComponent}
multiple
/>
@@ -1,8 +1,8 @@
import { connect } from 'react-redux';
import { connect } from "react-redux";
import { makeGetStatus } from 'mastodon/selectors';
import { makeGetStatus } from "mastodon/selectors";
import StatusCheckBox from '../components/status_check_box';
import StatusCheckBox from "../components/status_check_box";
const makeMapStateToProps = () => {
const getStatus = makeGetStatus();
@@ -1,17 +1,17 @@
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import PropTypes from "prop-types";
import { PureComponent } from "react";
import { FormattedMessage } from 'react-intl';
import { FormattedMessage } from "react-intl";
import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';
import ImmutablePropTypes from "react-immutable-proptypes";
import { connect } from "react-redux";
import Button from 'mastodon/components/button';
import Button from "mastodon/components/button";
import Option from './components/option';
import Option from "./components/option";
const mapStateToProps = state => ({
rules: state.getIn(['server', 'server', 'rules']),
rules: state.getIn(["server", "server", "rules"]),
});
class Rules extends PureComponent {
@@ -25,7 +25,7 @@ class Rules extends PureComponent {
handleNextClick = () => {
const { onNextStep } = this.props;
onNextStep('statuses');
onNextStep("statuses");
};
handleRulesToggle = (value, checked) => {
@@ -44,12 +44,12 @@ class Rules extends PureComponent {
<div>
{rules.map(item => (
<Option
key={item.get('id')}
key={item.get("id")}
name='rule_ids'
value={item.get('id')}
checked={selectedRuleIds.includes(item.get('id'))}
value={item.get("id")}
checked={selectedRuleIds.includes(item.get("id"))}
onToggle={this.handleRulesToggle}
label={item.get('text')}
label={item.get("text")}
multiple
/>
))}
@@ -1,19 +1,19 @@
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import PropTypes from "prop-types";
import { PureComponent } from "react";
import { FormattedMessage } from 'react-intl';
import { FormattedMessage } from "react-intl";
import { OrderedSet } from 'immutable';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';
import { OrderedSet } from "immutable";
import ImmutablePropTypes from "react-immutable-proptypes";
import { connect } from "react-redux";
import Button from 'mastodon/components/button';
import { LoadingIndicator } from 'mastodon/components/loading_indicator';
import StatusCheckBox from 'mastodon/features/report/containers/status_check_box_container';
import Button from "mastodon/components/button";
import { LoadingIndicator } from "mastodon/components/loading_indicator";
import StatusCheckBox from "mastodon/features/report/containers/status_check_box_container";
const mapStateToProps = (state, { accountId }) => ({
availableStatusIds: OrderedSet(state.getIn(['timelines', `account:${accountId}:with_replies`, 'items'])),
isLoading: state.getIn(['timelines', `account:${accountId}:with_replies`, 'isLoading']),
availableStatusIds: OrderedSet(state.getIn(["timelines", `account:${accountId}:with_replies`, "items"])),
isLoading: state.getIn(["timelines", `account:${accountId}:with_replies`, "isLoading"]),
});
class Statuses extends PureComponent {
@@ -29,7 +29,7 @@ class Statuses extends PureComponent {
handleNextClick = () => {
const { onNextStep } = this.props;
onNextStep('comment');
onNextStep("comment");
};
render () {
@@ -1,17 +1,17 @@
import PropTypes from 'prop-types';
import { PureComponent } from 'react';
import PropTypes from "prop-types";
import { PureComponent } from "react";
import { FormattedMessage } from 'react-intl';
import { FormattedMessage } from "react-intl";
import ImmutablePropTypes from 'react-immutable-proptypes';
import { connect } from 'react-redux';
import ImmutablePropTypes from "react-immutable-proptypes";
import { connect } from "react-redux";
import {
unfollowAccount,
muteAccount,
blockAccount,
} from 'mastodon/actions/accounts';
import Button from 'mastodon/components/button';
} from "mastodon/actions/accounts";
import Button from "mastodon/components/button";
const mapStateToProps = () => ({});
@@ -31,19 +31,19 @@ class Thanks extends PureComponent {
handleUnfollowClick = () => {
const { dispatch, account, onClose } = this.props;
dispatch(unfollowAccount(account.get('id')));
dispatch(unfollowAccount(account.get("id")));
onClose();
};
handleMuteClick = () => {
const { dispatch, account, onClose } = this.props;
dispatch(muteAccount(account.get('id')));
dispatch(muteAccount(account.get("id")));
onClose();
};
handleBlockClick = () => {
const { dispatch, account, onClose } = this.props;
dispatch(blockAccount(account.get('id')));
dispatch(blockAccount(account.get("id")));
onClose();
};
@@ -53,26 +53,26 @@ class Thanks extends PureComponent {
return (
<>
<h3 className='report-dialog-modal__title'>{submitted ? <FormattedMessage id='report.thanks.title_actionable' defaultMessage="Thanks for reporting, we'll look into this." /> : <FormattedMessage id='report.thanks.title' defaultMessage="Don't want to see this?" />}</h3>
<p className='report-dialog-modal__lead'>{submitted ? <FormattedMessage id='report.thanks.take_action_actionable' defaultMessage='While we review this, you can take action against @{name}:' values={{ name: account.get('username') }} /> : <FormattedMessage id='report.thanks.take_action' defaultMessage='Here are your options for controlling what you see on Mastodon:' />}</p>
<p className='report-dialog-modal__lead'>{submitted ? <FormattedMessage id='report.thanks.take_action_actionable' defaultMessage='While we review this, you can take action against @{name}:' values={{ name: account.get("username") }} /> : <FormattedMessage id='report.thanks.take_action' defaultMessage='Here are your options for controlling what you see on Mastodon:' />}</p>
{account.getIn(['relationship', 'following']) && (
{account.getIn(["relationship", "following"]) && (
<>
<h4 className='report-dialog-modal__subtitle'><FormattedMessage id='report.unfollow' defaultMessage='Unfollow @{name}' values={{ name: account.get('username') }} /></h4>
<h4 className='report-dialog-modal__subtitle'><FormattedMessage id='report.unfollow' defaultMessage='Unfollow @{name}' values={{ name: account.get("username") }} /></h4>
<p className='report-dialog-modal__lead'><FormattedMessage id='report.unfollow_explanation' defaultMessage='You are following this account. To not see their posts in your home feed anymore, unfollow them.' /></p>
<Button secondary onClick={this.handleUnfollowClick}><FormattedMessage id='account.unfollow' defaultMessage='Unfollow' /></Button>
<hr />
</>
)}
<h4 className='report-dialog-modal__subtitle'><FormattedMessage id='account.mute' defaultMessage='Mute @{name}' values={{ name: account.get('username') }} /></h4>
<h4 className='report-dialog-modal__subtitle'><FormattedMessage id='account.mute' defaultMessage='Mute @{name}' values={{ name: account.get("username") }} /></h4>
<p className='report-dialog-modal__lead'><FormattedMessage id='report.mute_explanation' defaultMessage='You will not see their posts. They can still follow you and see your posts and will not know that they are muted.' /></p>
<Button secondary onClick={this.handleMuteClick}>{!account.getIn(['relationship', 'muting']) ? <FormattedMessage id='report.mute' defaultMessage='Mute' /> : <FormattedMessage id='account.muted' defaultMessage='Muted' />}</Button>
<Button secondary onClick={this.handleMuteClick}>{!account.getIn(["relationship", "muting"]) ? <FormattedMessage id='report.mute' defaultMessage='Mute' /> : <FormattedMessage id='account.muted' defaultMessage='Muted' />}</Button>
<hr />
<h4 className='report-dialog-modal__subtitle'><FormattedMessage id='account.block' defaultMessage='Block @{name}' values={{ name: account.get('username') }} /></h4>
<h4 className='report-dialog-modal__subtitle'><FormattedMessage id='account.block' defaultMessage='Block @{name}' values={{ name: account.get("username") }} /></h4>
<p className='report-dialog-modal__lead'><FormattedMessage id='report.block_explanation' defaultMessage='You will not see their posts. They will not be able to see your posts or follow you. They will be able to tell that they are blocked.' /></p>
<Button secondary onClick={this.handleBlockClick}>{!account.getIn(['relationship', 'blocking']) ? <FormattedMessage id='report.block' defaultMessage='Block' /> : <FormattedMessage id='account.blocked' defaultMessage='Blocked' />}</Button>
<Button secondary onClick={this.handleBlockClick}>{!account.getIn(["relationship", "blocking"]) ? <FormattedMessage id='report.block' defaultMessage='Block' /> : <FormattedMessage id='account.blocked' defaultMessage='Blocked' />}</Button>
<div className='flex-spacer' />