[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,17 +1,17 @@
import PropTypes from 'prop-types';
import { Fragment } from 'react';
import PropTypes from "prop-types";
import { Fragment } from "react";
import classNames from 'classnames';
import classNames from "classnames";
import { Check } from 'mastodon/components/check';
import { Check } from "mastodon/components/check";
const ProgressIndicator = ({ steps, completed }) => (
<div className='onboarding__progress-indicator'>
{(new Array(steps)).fill().map((_, i) => (
<Fragment key={i}>
{i > 0 && <div className={classNames('onboarding__progress-indicator__line', { active: completed > i })} />}
{i > 0 && <div className={classNames("onboarding__progress-indicator__line", { active: completed > i })} />}
<div className={classNames('onboarding__progress-indicator__step', { active: completed > i })}>
<div className={classNames("onboarding__progress-indicator__step", { active: completed > i })}>
{completed > i && <Check />}
</div>
</Fragment>
@@ -1,9 +1,9 @@
import PropTypes from 'prop-types';
import PropTypes from "prop-types";
import { Check } from 'mastodon/components/check';
import { Icon } from 'mastodon/components/icon';
import { Check } from "mastodon/components/check";
import { Icon } from "mastodon/components/icon";
import ArrowSmallRight from './arrow_small_right';
import ArrowSmallRight from "./arrow_small_right";
const Step = ({ label, description, icon, completed, onClick, href }) => {
const content = (
@@ -17,7 +17,7 @@ const Step = ({ label, description, icon, completed, onClick, href }) => {
<p>{description}</p>
</div>
<div className={completed ? 'onboarding__steps__item__progress' : 'onboarding__steps__item__go'}>
<div className={completed ? "onboarding__steps__item__progress" : "onboarding__steps__item__go"}>
{completed ? <Check /> : <ArrowSmallRight />}
</div>
</>
@@ -25,7 +25,7 @@ const Step = ({ label, description, icon, completed, onClick, href }) => {
if (href) {
return (
<a href={href} onClick={onClick} target='_blank' rel='noopener' className='onboarding__steps__item'>
<a href={href} onClick={onClick} target='_blank' rel="noopener noreferrer" className='onboarding__steps__item'>
{content}
</a>
);
@@ -1,21 +1,21 @@
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 { fetchSuggestions } from 'mastodon/actions/suggestions';
import { markAsPartial } from 'mastodon/actions/timelines';
import Column from 'mastodon/components/column';
import ColumnBackButton from 'mastodon/components/column_back_button';
import { EmptyAccount } from 'mastodon/components/empty_account';
import Account from 'mastodon/containers/account_container';
import { fetchSuggestions } from "mastodon/actions/suggestions";
import { markAsPartial } from "mastodon/actions/timelines";
import Column from "mastodon/components/column";
import ColumnBackButton from "mastodon/components/column_back_button";
import { EmptyAccount } from "mastodon/components/empty_account";
import Account from "mastodon/containers/account_container";
const mapStateToProps = state => ({
suggestions: state.getIn(['suggestions', 'items']),
isLoading: state.getIn(['suggestions', 'isLoading']),
suggestions: state.getIn(["suggestions", "items"]),
isLoading: state.getIn(["suggestions", "isLoading"]),
});
class Follows extends PureComponent {
@@ -35,7 +35,7 @@ class Follows extends PureComponent {
componentWillUnmount () {
const { dispatch } = this.props;
dispatch(markAsPartial('home'));
dispatch(markAsPartial("home"));
}
render () {
@@ -48,7 +48,7 @@ class Follows extends PureComponent {
} else if (suggestions.isEmpty()) {
loadedContent = <div className='follow-recommendations__empty'><FormattedMessage id='onboarding.follows.empty' defaultMessage='Unfortunately, no results can be shown right now. You can try using search or browsing the explore page to find people to follow, or try again later.' /></div>;
} else {
loadedContent = suggestions.map(suggestion => <Account id={suggestion.get('account')} key={suggestion.get('account')} withBio />);
loadedContent = suggestions.map(suggestion => <Account id={suggestion.get("account")} key={suggestion.get("account")} withBio />);
}
return (
@@ -1,32 +1,32 @@
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 { Helmet } from 'react-helmet';
import { Link } from 'react-router-dom';
import { Helmet } from "react-helmet";
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 { debounce } from 'lodash';
import { debounce } from "lodash";
import illustration from 'mastodon/../images/elephant_ui_conversation.svg';
import { fetchAccount } from 'mastodon/actions/accounts';
import { focusCompose } from 'mastodon/actions/compose';
import { closeOnboarding } from 'mastodon/actions/onboarding';
import Column from 'mastodon/features/ui/components/column';
import { me } from 'mastodon/initial_state';
import { makeGetAccount } from 'mastodon/selectors';
import { assetHost } from 'mastodon/utils/config';
import illustration from "mastodon/../images/elephant_ui_conversation.svg";
import { fetchAccount } from "mastodon/actions/accounts";
import { focusCompose } from "mastodon/actions/compose";
import { closeOnboarding } from "mastodon/actions/onboarding";
import Column from "mastodon/features/ui/components/column";
import { me } from "mastodon/initial_state";
import { makeGetAccount } from "mastodon/selectors";
import { assetHost } from "mastodon/utils/config";
import ArrowSmallRight from './components/arrow_small_right';
import Step from './components/step';
import Follows from './follows';
import Share from './share';
import ArrowSmallRight from "./components/arrow_small_right";
import Step from "./components/step";
import Follows from "./follows";
import Share from "./share";
const messages = defineMessages({
template: { id: 'onboarding.compose.template', defaultMessage: 'Hello #Mastodon!' },
template: { id: "onboarding.compose.template", defaultMessage: "Hello #Mastodon!" },
});
const mapStateToProps = () => {
@@ -60,7 +60,7 @@ class Onboarding extends ImmutablePureComponent {
const { router } = this.context;
dispatch(closeOnboarding());
router.history.push('/home');
router.history.push("/home");
};
handleProfileClick = () => {
@@ -68,7 +68,7 @@ class Onboarding extends ImmutablePureComponent {
};
handleFollowClick = () => {
this.setState({ step: 'follows' });
this.setState({ step: "follows" });
};
handleComposeClick = () => {
@@ -79,7 +79,7 @@ class Onboarding extends ImmutablePureComponent {
};
handleShareClick = () => {
this.setState({ step: 'share', shareClicked: true });
this.setState({ step: "share", shareClicked: true });
};
handleBackClick = () => {
@@ -88,15 +88,15 @@ class Onboarding extends ImmutablePureComponent {
handleWindowFocus = debounce(() => {
const { dispatch, account } = this.props;
dispatch(fetchAccount(account.get('id')));
dispatch(fetchAccount(account.get("id")));
}, 1000, { trailing: true });
componentDidMount () {
window.addEventListener('focus', this.handleWindowFocus, false);
window.addEventListener("focus", this.handleWindowFocus, false);
}
componentWillUnmount () {
window.removeEventListener('focus', this.handleWindowFocus);
window.removeEventListener("focus", this.handleWindowFocus);
}
render () {
@@ -104,10 +104,10 @@ class Onboarding extends ImmutablePureComponent {
const { step, shareClicked } = this.state;
switch(step) {
case 'follows':
return <Follows onBack={this.handleBackClick} multiColumn={multiColumn} />;
case 'share':
return <Share onBack={this.handleBackClick} multiColumn={multiColumn} />;
case "follows":
return <Follows onBack={this.handleBackClick} multiColumn={multiColumn} />;
case "share":
return <Share onBack={this.handleBackClick} multiColumn={multiColumn} />;
}
return (
@@ -120,9 +120,9 @@ class Onboarding extends ImmutablePureComponent {
</div>
<div className='onboarding__steps'>
<Step onClick={this.handleProfileClick} href='/settings/profile' completed={(!account.get('avatar').endsWith('missing.png')) || (account.get('display_name').length > 0 && account.get('note').length > 0)} icon='address-book-o' label={<FormattedMessage id='onboarding.steps.setup_profile.title' defaultMessage='Customize your profile' />} description={<FormattedMessage id='onboarding.steps.setup_profile.body' defaultMessage='Others are more likely to interact with you with a filled out profile.' />} />
<Step onClick={this.handleFollowClick} completed={(account.get('following_count') * 1) >= 7} icon='user-plus' label={<FormattedMessage id='onboarding.steps.follow_people.title' defaultMessage='Find at least {count, plural, one {one person} other {# people}} to follow' values={{ count: 7 }} />} description={<FormattedMessage id='onboarding.steps.follow_people.body' defaultMessage="You curate your own home feed. Let's fill it with interesting people." />} />
<Step onClick={this.handleComposeClick} completed={(account.get('statuses_count') * 1) >= 1} icon='pencil-square-o' label={<FormattedMessage id='onboarding.steps.publish_status.title' defaultMessage='Make your first post' />} description={<FormattedMessage id='onboarding.steps.publish_status.body' defaultMessage='Say hello to the world.' values={{ emoji: <img className='emojione' alt='🐘' src={`${assetHost}/emoji/1f418.svg`} /> }} />} />
<Step onClick={this.handleProfileClick} href='/settings/profile' completed={(!account.get("avatar").endsWith("missing.png")) || (account.get("display_name").length > 0 && account.get("note").length > 0)} icon='address-book-o' label={<FormattedMessage id='onboarding.steps.setup_profile.title' defaultMessage='Customize your profile' />} description={<FormattedMessage id='onboarding.steps.setup_profile.body' defaultMessage='Others are more likely to interact with you with a filled out profile.' />} />
<Step onClick={this.handleFollowClick} completed={(account.get("following_count") * 1) >= 7} icon='user-plus' label={<FormattedMessage id='onboarding.steps.follow_people.title' defaultMessage='Find at least {count, plural, one {one person} other {# people}} to follow' values={{ count: 7 }} />} description={<FormattedMessage id='onboarding.steps.follow_people.body' defaultMessage="You curate your own home feed. Let's fill it with interesting people." />} />
<Step onClick={this.handleComposeClick} completed={(account.get("statuses_count") * 1) >= 1} icon='pencil-square-o' label={<FormattedMessage id='onboarding.steps.publish_status.title' defaultMessage='Make your first post' />} description={<FormattedMessage id='onboarding.steps.publish_status.body' defaultMessage='Say hello to the world.' values={{ emoji: <img className='emojione' alt='🐘' src={`${assetHost}/emoji/1f418.svg`} /> }} />} />
<Step onClick={this.handleShareClick} completed={shareClicked} icon='copy' label={<FormattedMessage id='onboarding.steps.share_profile.title' defaultMessage='Share your profile' />} description={<FormattedMessage id='onboarding.steps.share_profile.body' defaultMessage='Let your friends know how to find you on Mastodon!' />} />
</div>
@@ -1,29 +1,29 @@
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 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 { connect } from 'react-redux';
import ImmutablePropTypes from "react-immutable-proptypes";
import { connect } from "react-redux";
import SwipeableViews from 'react-swipeable-views';
import SwipeableViews from "react-swipeable-views";
import Column from 'mastodon/components/column';
import ColumnBackButton from 'mastodon/components/column_back_button';
import { Icon } from 'mastodon/components/icon';
import { me, domain } from 'mastodon/initial_state';
import Column from "mastodon/components/column";
import ColumnBackButton from "mastodon/components/column_back_button";
import { Icon } from "mastodon/components/icon";
import { me, domain } from "mastodon/initial_state";
import ArrowSmallRight from './components/arrow_small_right';
import ArrowSmallRight from "./components/arrow_small_right";
const messages = defineMessages({
shareableMessage: { id: 'onboarding.share.message', defaultMessage: 'I\'m {username} on #Mastodon! Come follow me at {url}' },
shareableMessage: { id: "onboarding.share.message", defaultMessage: "I'm {username} on #Mastodon! Come follow me at {url}" },
});
const mapStateToProps = state => ({
account: state.getIn(['accounts', me]),
account: state.getIn(["accounts", me]),
});
class CopyPasteText extends PureComponent {
@@ -67,7 +67,9 @@ class CopyPasteText extends PureComponent {
};
componentWillUnmount () {
if (this.timeout) clearTimeout(this.timeout);
if (this.timeout) {
clearTimeout(this.timeout);
}
}
render () {
@@ -75,7 +77,7 @@ class CopyPasteText extends PureComponent {
const { copied, focused } = this.state;
return (
<div className={classNames('copy-paste-text', { copied, focused })} tabIndex='0' role='button' onClick={this.handleInputClick}>
<div className={classNames("copy-paste-text", { copied, focused })} tabIndex='0' role='button' onClick={this.handleInputClick}>
<textarea readOnly value={value} ref={this.setRef} onClick={this.handleInputClick} onFocus={this.handleFocus} onBlur={this.handleBlur} />
<button className='button' onClick={this.handleButtonClick}>
@@ -102,19 +104,19 @@ class TipCarousel extends PureComponent {
};
handleChangeIndex = e => {
this.setState({ index: Number(e.currentTarget.getAttribute('data-index')) });
this.setState({ index: Number(e.currentTarget.getAttribute("data-index")) });
};
handleKeyDown = e => {
switch(e.key) {
case 'ArrowLeft':
e.preventDefault();
this.setState(({ index }, { children }) => ({ index: Math.abs(index - 1) % children.length }));
break;
case 'ArrowRight':
e.preventDefault();
this.setState(({ index }, { children }) => ({ index: (index + 1) % children.length }));
break;
case "ArrowLeft":
e.preventDefault();
this.setState(({ index }, { children }) => ({ index: Math.abs(index - 1) % children.length }));
break;
case "ArrowRight":
e.preventDefault();
this.setState(({ index }, { children }) => ({ index: (index + 1) % children.length }));
break;
}
};
@@ -130,7 +132,7 @@ class TipCarousel extends PureComponent {
<div className='media-modal__pagination'>
{children.map((_, i) => (
<button key={i} className={classNames('media-modal__page-dot', { active: i === index })} data-index={i} onClick={this.handleChangeIndex}>
<button key={i} className={classNames("media-modal__page-dot", { active: i === index })} data-index={i} onClick={this.handleChangeIndex}>
{i + 1}
</button>
))}
@@ -153,7 +155,7 @@ class Share extends PureComponent {
render () {
const { onBack, account, multiColumn, intl } = this.props;
const url = (new URL(`/@${account.get('username')}`, document.baseURI)).href;
const url = (new URL(`/@${account.get("username")}`, document.baseURI)).href;
return (
<Column>
@@ -165,7 +167,7 @@ class Share extends PureComponent {
<p><FormattedMessage id='onboarding.share.lead' defaultMessage='Let people know how they can find you on Mastodon!' /></p>
</div>
<CopyPasteText value={intl.formatMessage(messages.shareableMessage, { username: `@${account.get('username')}@${domain}`, url })} />
<CopyPasteText value={intl.formatMessage(messages.shareableMessage, { username: `@${account.get("username")}@${domain}`, url })} />
<TipCarousel>
<div><p className='onboarding__lead'><FormattedMessage id='onboarding.tips.verification' defaultMessage='<strong>Did you know?</strong> You can verify your account by putting a link to your Mastodon profile on your own website and adding the website to your profile. No fees or documents necessary!' values={{ strong: chunks => <strong>{chunks}</strong> }} /></p></div>