From a426db2101b4eb689028ac6f8f0c00261e22b800 Mon Sep 17 00:00:00 2001
From: takayamaki / fusagiko <24884114+takayamaki@users.noreply.github.com>
Date: Thu, 5 Oct 2023 23:18:25 +0900
Subject: [PATCH] yarn test:lint:js --fix
---
app/javascript/mastodon/components/avatar_overlay_icon.js | 4 +++-
app/javascript/mastodon/components/status.js | 7 +++----
.../mastodon/features/compose/components/compose_form.js | 2 +-
.../mastodon/features/compose/components/favourite_tags.js | 2 +-
.../hashtag_timeline/components/favourite_toggle.js | 4 ++--
.../mastodon/features/ui/components/navigation_panel.js | 6 +++---
app/javascript/mastodon/reducers/trend_tags.js | 2 +-
app/javascript/mastodon/reducers/user_lists.js | 2 +-
streaming/index.js | 6 +++---
9 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/app/javascript/mastodon/components/avatar_overlay_icon.js b/app/javascript/mastodon/components/avatar_overlay_icon.js
index 5dbedf2a21e500..929f69e3caea1a 100644
--- a/app/javascript/mastodon/components/avatar_overlay_icon.js
+++ b/app/javascript/mastodon/components/avatar_overlay_icon.js
@@ -11,6 +11,7 @@ const icons = {
};
export default class AvatarOverlayIcon extends React.PureComponent {
+
static propTypes = {
account: ImmutablePropTypes.map.isRequired,
visibility: PropTypes.string.isRequired,
@@ -23,7 +24,7 @@ export default class AvatarOverlayIcon extends React.PureComponent {
render() {
const { account, visibility, animate } = this.props;
- const icon = icons[visibility]
+ const icon = icons[visibility];
const baseStyle = {
backgroundImage: `url(${account.get(animate ? 'avatar' : 'avatar_static')})`,
@@ -36,4 +37,5 @@ export default class AvatarOverlayIcon extends React.PureComponent {
);
}
+
}
diff --git a/app/javascript/mastodon/components/status.js b/app/javascript/mastodon/components/status.js
index e05d0560741e92..a94f67c42dcb5f 100644
--- a/app/javascript/mastodon/components/status.js
+++ b/app/javascript/mastodon/components/status.js
@@ -4,7 +4,6 @@ import PropTypes from 'prop-types';
import Avatar from './avatar';
import AvatarOverlay from './avatar_overlay';
import AvatarOverlayIcon from './avatar_overlay_icon';
-import AvatarComposite from './avatar_composite';
import RelativeTimestamp from './relative_timestamp';
import DisplayName from './display_name';
import StatusContent from './status_content';
@@ -491,10 +490,10 @@ class Status extends ImmutablePureComponent {
);
}
- if (account == null && status.get('visibility') === 'public') {
+ if (account === null && status.get('visibility') === 'public') {
statusAvatar = ;
- } else if (account == null) {
- statusAvatar =
+ } else if (account === null) {
+ statusAvatar = ;
} else {
statusAvatar = ;
}
diff --git a/app/javascript/mastodon/features/compose/components/compose_form.js b/app/javascript/mastodon/features/compose/components/compose_form.js
index 725d10e4a9d83c..f25a1eae343ad6 100644
--- a/app/javascript/mastodon/features/compose/components/compose_form.js
+++ b/app/javascript/mastodon/features/compose/components/compose_form.js
@@ -174,7 +174,7 @@ class ComposeForm extends ImmutablePureComponent {
this.autosuggestTextarea.textarea.focus();
}).catch(console.error);
} else if(prevProps.isSubmitting && !this.props.isSubmitting) {
- this.autosuggestTextarea.textarea.setSelectionRange(0, 0)
+ this.autosuggestTextarea.textarea.setSelectionRange(0, 0);
this.autosuggestTextarea.textarea.focus();
} else if (this.props.spoiler !== prevProps.spoiler) {
if (this.props.spoiler) {
diff --git a/app/javascript/mastodon/features/compose/components/favourite_tags.js b/app/javascript/mastodon/features/compose/components/favourite_tags.js
index 554eab168bf97e..47a4e43c980a47 100644
--- a/app/javascript/mastodon/features/compose/components/favourite_tags.js
+++ b/app/javascript/mastodon/features/compose/components/favourite_tags.js
@@ -45,7 +45,7 @@ class FavouriteTags extends React.PureComponent {
const icon = icons.concat().reverse().find(icon => nextState.lockedVisibility.includes(icon.key));
this.execLockTag(
nextState.lockedTag.join(' '),
- typeof icon === 'undefined' ? '' : icon.key
+ typeof icon === 'undefined' ? '' : icon.key,
);
}
}
diff --git a/app/javascript/mastodon/features/hashtag_timeline/components/favourite_toggle.js b/app/javascript/mastodon/features/hashtag_timeline/components/favourite_toggle.js
index 2d18e2ddbdc04a..1b8b8d24f6024e 100644
--- a/app/javascript/mastodon/features/hashtag_timeline/components/favourite_toggle.js
+++ b/app/javascript/mastodon/features/hashtag_timeline/components/favourite_toggle.js
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import Button from '../../../components/button';
-import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
+import { defineMessages, injectIntl } from 'react-intl';
const messages = defineMessages({
add_favourite_tags_public: { id: 'tag.add_favourite.public', defaultMessage: 'add in the favourite tags (Public)' },
@@ -45,7 +45,7 @@ export default class FavouriteToggle extends React.PureComponent {
- :
+ :
diff --git a/app/javascript/mastodon/features/ui/components/navigation_panel.js b/app/javascript/mastodon/features/ui/components/navigation_panel.js
index 015f880f0802fa..f3b8f8e3b9a5a8 100644
--- a/app/javascript/mastodon/features/ui/components/navigation_panel.js
+++ b/app/javascript/mastodon/features/ui/components/navigation_panel.js
@@ -27,7 +27,7 @@ const messages = defineMessages({
followsAndFollowers: { id: 'navigation_bar.follows_and_followers', defaultMessage: 'Follows and followers' },
about: { id: 'navigation_bar.about', defaultMessage: 'About' },
search: { id: 'navigation_bar.search', defaultMessage: 'Search' },
- faq: { id: 'navigation_bar.faq', defaultMessage: 'FAQ'}
+ faq: { id: 'navigation_bar.faq', defaultMessage: 'FAQ' },
});
export default @injectIntl
@@ -93,7 +93,7 @@ class NavigationPanel extends React.Component {
-
+
@@ -108,7 +108,7 @@ class NavigationPanel extends React.Component {
-
+
);
}
diff --git a/app/javascript/mastodon/reducers/trend_tags.js b/app/javascript/mastodon/reducers/trend_tags.js
index 689c1bc4e56774..55713693c1e2b3 100644
--- a/app/javascript/mastodon/reducers/trend_tags.js
+++ b/app/javascript/mastodon/reducers/trend_tags.js
@@ -1,6 +1,6 @@
import { TREND_TAGS_SUCCESS,
TREND_TAGS_HISTORY_SUCCESS,
- TOGGLE_TREND_TAGS
+ TOGGLE_TREND_TAGS,
} from '../actions/trend_tags';
import Immutable from 'immutable';
diff --git a/app/javascript/mastodon/reducers/user_lists.js b/app/javascript/mastodon/reducers/user_lists.js
index f19c1e2e9d4872..88b51fb63c15e0 100644
--- a/app/javascript/mastodon/reducers/user_lists.js
+++ b/app/javascript/mastodon/reducers/user_lists.js
@@ -22,7 +22,7 @@ import {
FOLLOW_REQUESTS_EXPAND_FAIL,
FOLLOW_REQUEST_AUTHORIZE_SUCCESS,
FOLLOW_REQUEST_REJECT_SUCCESS,
- } from '../actions/accounts';
+} from '../actions/accounts';
import {
REBLOGS_FETCH_SUCCESS,
FAVOURITES_FETCH_SUCCESS,
diff --git a/streaming/index.js b/streaming/index.js
index dc382b5bb75844..e382e49c866093 100644
--- a/streaming/index.js
+++ b/streaming/index.js
@@ -728,7 +728,7 @@ const startWorker = async (workerId) => {
// If the payload already contains the `filtered` property, it means
// that filtering has been applied on the ruby on rails side, as
// such, we don't need to construct or apply the filters in streaming:
- if (Object.prototype.hasOwnProperty.call(payload, "filtered")) {
+ if (Object.prototype.hasOwnProperty.call(payload, 'filtered')) {
transmit(event, payload);
return;
}
@@ -815,7 +815,7 @@ const startWorker = async (workerId) => {
results.push({
filter: cachedFilter.filter,
keyword_matches,
- status_matches: null
+ status_matches: null,
});
}
@@ -830,7 +830,7 @@ const startWorker = async (workerId) => {
// filtered: https://docs.joinmastodon.org/entities/Status/#filtered
transmit(event, {
...payload,
- filtered: filter_results
+ filtered: filter_results,
});
} else {
transmit(event, payload);