Merge branch 'no-duplicate-imports' into 'develop'

ESLint: add no-duplicate-imports rule

See merge request soapbox-pub/soapbox-fe!1505
chats-fixes
marcin mikołajczak 2022-06-07 20:31:37 +00:00
commit 921a13baad
28 zmienionych plików z 36 dodań i 54 usunięć

Wyświetl plik

@ -258,6 +258,7 @@ module.exports = {
alphabetize: { order: 'asc' },
},
],
'@typescript-eslint/no-duplicate-imports': 'error',
'promise/catch-or-return': 'error',

Wyświetl plik

@ -6,8 +6,7 @@ import { mockStore, rootState } from 'soapbox/jest/test-helpers';
import { normalizeStatus } from 'soapbox/normalizers/status';
import rootReducer from 'soapbox/reducers';
import { fetchContext } from '../statuses';
import { deleteStatus } from '../statuses';
import { deleteStatus, fetchContext } from '../statuses';
describe('fetchContext()', () => {
it('handles Mitra context', done => {

Wyświetl plik

@ -11,8 +11,7 @@ import { createSelector } from 'reselect';
import * as BuildConfig from 'soapbox/build_config';
import { RootState } from 'soapbox/store';
import { getAccessToken, getAppToken, parseBaseURL } from 'soapbox/utils/auth';
import { isURL } from 'soapbox/utils/auth';
import { getAccessToken, getAppToken, isURL, parseBaseURL } from 'soapbox/utils/auth';
/**
Parse Link headers, mostly for pagination.

Wyświetl plik

@ -1,6 +1,5 @@
import classNames from 'classnames';
import { is } from 'immutable';
import { Map as ImmutableMap } from 'immutable';
import { Map as ImmutableMap, is } from 'immutable';
import PropTypes from 'prop-types';
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';

Wyświetl plik

@ -4,8 +4,7 @@ import { defineMessages, useIntl, FormattedMessage } from 'react-intl';
import { useDispatch } from 'react-redux';
import { Link, NavLink } from 'react-router-dom';
import { logOut, switchAccount } from 'soapbox/actions/auth';
import { fetchOwnAccounts } from 'soapbox/actions/auth';
import { fetchOwnAccounts, logOut, switchAccount } from 'soapbox/actions/auth';
import { getSettings } from 'soapbox/actions/settings';
import { closeSidebar } from 'soapbox/actions/sidebar';
import Account from 'soapbox/components/account';

Wyświetl plik

@ -6,6 +6,7 @@ import { connect } from 'react-redux';
import { withRouter, RouteComponentProps } from 'react-router-dom';
import { simpleEmojiReact } from 'soapbox/actions/emoji_reacts';
import { openModal } from 'soapbox/actions/modals';
import EmojiButtonWrapper from 'soapbox/components/emoji-button-wrapper';
import StatusActionButton from 'soapbox/components/status-action-button';
import DropdownMenuContainer from 'soapbox/containers/dropdown_menu_container';
@ -13,8 +14,6 @@ import { isUserTouching } from 'soapbox/is_mobile';
import { getReactForStatus, reduceEmoji } from 'soapbox/utils/emoji_reacts';
import { getFeatures } from 'soapbox/utils/features';
import { openModal } from '../actions/modals';
import type { History } from 'history';
import type { AnyAction, Dispatch } from 'redux';
import type { Menu } from 'soapbox/components/dropdown_menu';

Wyświetl plik

@ -13,8 +13,7 @@ import { openModal } from 'soapbox/actions/modals';
import { expandAccountMediaTimeline } from 'soapbox/actions/timelines';
import LoadMore from 'soapbox/components/load_more';
import MissingIndicator from 'soapbox/components/missing_indicator';
import { Column } from 'soapbox/components/ui';
import { Spinner } from 'soapbox/components/ui';
import { Column, Spinner } from 'soapbox/components/ui';
import { getAccountGallery, findAccountByUsername } from 'soapbox/selectors';
import { getFeatures } from 'soapbox/utils/features';

Wyświetl plik

@ -7,8 +7,7 @@ import { fetchUsers } from 'soapbox/actions/admin';
import compareId from 'soapbox/compare_id';
import { Widget } from 'soapbox/components/ui';
import AccountContainer from 'soapbox/containers/account_container';
import { useAppSelector } from 'soapbox/hooks';
import { useAppDispatch } from 'soapbox/hooks';
import { useAppDispatch, useAppSelector } from 'soapbox/hooks';
const messages = defineMessages({
title: { id: 'admin.latest_accounts_panel.title', defaultMessage: 'Latest Accounts' },

Wyświetl plik

@ -1,13 +1,11 @@
import classNames from 'classnames';
import { throttle } from 'lodash';
import { debounce } from 'lodash';
import { debounce, throttle } from 'lodash';
import PropTypes from 'prop-types';
import React from 'react';
import { defineMessages, injectIntl } from 'react-intl';
import Icon from 'soapbox/components/icon';
import { formatTime } from 'soapbox/features/video';
import { getPointerPosition, fileNameFromURL } from 'soapbox/features/video';
import { formatTime, getPointerPosition, fileNameFromURL } from 'soapbox/features/video';
import Visualizer from './visualizer';

Wyświetl plik

@ -3,8 +3,7 @@ import PropTypes from 'prop-types';
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { FormattedMessage } from 'react-intl';
import { injectIntl, defineMessages } from 'react-intl';
import { injectIntl, defineMessages, FormattedMessage } from 'react-intl';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import { createSelector } from 'reselect';

Wyświetl plik

@ -3,8 +3,7 @@ import PropTypes from 'prop-types';
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { FormattedMessage } from 'react-intl';
import { defineMessages, injectIntl } from 'react-intl';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import Hashtag from 'soapbox/components/hashtag';
import ScrollableList from 'soapbox/components/scrollable_list';

Wyświetl plik

@ -1,7 +1,11 @@
import { connect } from 'react-redux';
import { addPollOption, removePollOption, changePollOption, changePollSettings, removePoll } from '../../../actions/compose';
import {
addPollOption,
removePollOption,
changePollOption,
changePollSettings,
removePoll,
clearComposeSuggestions,
fetchComposeSuggestions,
selectComposeSuggestion,

Wyświetl plik

@ -1,8 +1,7 @@
import { List as ImmutableList } from 'immutable';
import { connect } from 'react-redux';
import { undoUploadCompose, changeUploadCompose } from '../../../actions/compose';
import { submitCompose } from '../../../actions/compose';
import { undoUploadCompose, changeUploadCompose, submitCompose } from '../../../actions/compose';
import { openModal } from '../../../actions/modals';
import Upload from '../components/upload';

Wyświetl plik

@ -8,8 +8,7 @@ import { fetchFilters, createFilter, deleteFilter } from 'soapbox/actions/filter
import snackbar from 'soapbox/actions/snackbar';
import Icon from 'soapbox/components/icon';
import ScrollableList from 'soapbox/components/scrollable_list';
import { Button } from 'soapbox/components/ui';
import { CardHeader, CardTitle, Column, Form, FormActions, FormGroup, Input, Text } from 'soapbox/components/ui';
import { Button, CardHeader, CardTitle, Column, Form, FormActions, FormGroup, Input, Text } from 'soapbox/components/ui';
import {
FieldsGroup,
Checkbox,

Wyświetl plik

@ -3,8 +3,7 @@ import PropTypes from 'prop-types';
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { FormattedMessage } from 'react-intl';
import { defineMessages, injectIntl } from 'react-intl';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { connect } from 'react-redux';
import { Spinner } from 'soapbox/components/ui';

Wyświetl plik

@ -1,5 +1,4 @@
import React from 'react';
import { useEffect } from 'react';
import React, { useEffect } from 'react';
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
import { createSelector } from 'reselect';

Wyświetl plik

@ -1,5 +1,4 @@
import React from 'react';
import { useEffect } from 'react';
import React, { useEffect } from 'react';
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
import { setupListEditor, resetListEditor } from 'soapbox/actions/lists';

Wyświetl plik

@ -8,8 +8,7 @@ import { deleteList, fetchLists } from 'soapbox/actions/lists';
import { openModal } from 'soapbox/actions/modals';
import Icon from 'soapbox/components/icon';
import ScrollableList from 'soapbox/components/scrollable_list';
import { IconButton, Spinner } from 'soapbox/components/ui';
import { CardHeader, CardTitle } from 'soapbox/components/ui';
import { CardHeader, CardTitle, IconButton, Spinner } from 'soapbox/components/ui';
import { useAppSelector } from 'soapbox/hooks';
import Column from '../ui/components/column';

Wyświetl plik

@ -1,7 +1,6 @@
import React from 'react';
import { HotKeys } from 'react-hotkeys';
import { defineMessages, FormattedMessage, IntlShape, MessageDescriptor } from 'react-intl';
import { useIntl } from 'react-intl';
import { defineMessages, useIntl, FormattedMessage, IntlShape, MessageDescriptor } from 'react-intl';
import { useHistory } from 'react-router-dom';
import Icon from 'soapbox/components/icon';

Wyświetl plik

@ -2,8 +2,7 @@ import { defineMessages, injectIntl } from 'react-intl';
import { connect } from 'react-redux';
import { openModal } from 'soapbox/actions/modals';
import { setFilter } from 'soapbox/actions/notifications';
import { clearNotifications } from 'soapbox/actions/notifications';
import { clearNotifications, setFilter } from 'soapbox/actions/notifications';
import { changeAlerts as changePushNotifications } from 'soapbox/actions/push_notifications';
import { getSettings, changeSetting } from 'soapbox/actions/settings';
import { getFeatures } from 'soapbox/utils/features';

Wyświetl plik

@ -1,8 +1,7 @@
import classNames from 'classnames';
import React from 'react';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { FormattedMessage, injectIntl, WrappedComponentProps as IntlProps } from 'react-intl';
import { FormattedDate } from 'react-intl';
import { FormattedDate, FormattedMessage, injectIntl, WrappedComponentProps as IntlProps } from 'react-intl';
import Icon from 'soapbox/components/icon';
import StatusMedia from 'soapbox/components/status-media';

Wyświetl plik

@ -45,8 +45,9 @@ import {
hideStatus,
revealStatus,
editStatus,
fetchStatusWithContext,
fetchNext,
} from 'soapbox/actions/statuses';
import { fetchStatusWithContext, fetchNext } from 'soapbox/actions/statuses';
import MissingIndicator from 'soapbox/components/missing_indicator';
import ScrollableList from 'soapbox/components/scrollable_list';
import { textForScreenReader, defaultMediaVisibility } from 'soapbox/components/status';

Wyświetl plik

@ -4,8 +4,7 @@ import { defineMessages, useIntl } from 'react-intl';
import { useDispatch } from 'react-redux';
import { Link } from 'react-router-dom';
import { logOut, switchAccount } from 'soapbox/actions/auth';
import { fetchOwnAccounts } from 'soapbox/actions/auth';
import { fetchOwnAccounts, logOut, switchAccount } from 'soapbox/actions/auth';
import Account from 'soapbox/components/account';
import { Menu, MenuButton, MenuDivider, MenuItem, MenuLink, MenuList } from 'soapbox/components/ui';
import { useAppSelector, useFeatures } from 'soapbox/hooks';

Wyświetl plik

@ -3,8 +3,7 @@ import { debounce } from 'lodash';
import React, { useCallback } from 'react';
import { defineMessages } from 'react-intl';
import { dequeueTimeline } from 'soapbox/actions/timelines';
import { scrollTopTimeline } from 'soapbox/actions/timelines';
import { dequeueTimeline, scrollTopTimeline } from 'soapbox/actions/timelines';
import ScrollTopButton from 'soapbox/components/scroll-top-button';
import StatusList, { IStatusList } from 'soapbox/components/status_list';
import { useAppSelector, useAppDispatch } from 'soapbox/hooks';

Wyświetl plik

@ -29,13 +29,11 @@ import AdminPage from 'soapbox/pages/admin_page';
import DefaultPage from 'soapbox/pages/default_page';
// import GroupsPage from 'soapbox/pages/groups_page';
// import GroupPage from 'soapbox/pages/group_page';
import EmptyPage from 'soapbox/pages/default_page';
import HomePage from 'soapbox/pages/home_page';
import ProfilePage from 'soapbox/pages/profile_page';
import RemoteInstancePage from 'soapbox/pages/remote_instance_page';
import StatusPage from 'soapbox/pages/status_page';
import { getAccessToken } from 'soapbox/utils/auth';
import { getVapidKey } from 'soapbox/utils/auth';
import { getAccessToken, getVapidKey } from 'soapbox/utils/auth';
import { cacheCurrentUrl } from 'soapbox/utils/redirect';
import { isStandalone } from 'soapbox/utils/state';
// import GroupSidebarPanel from '../groups/sidebar_panel';
@ -120,6 +118,8 @@ import { WrappedRoute } from './util/react_router_helpers';
// Without this it ends up in ~8 very commonly used bundles.
import 'soapbox/components/status';
const EmptyPage = HomePage;
const isMobile = (width: number): boolean => width <= 1190;
const messages = defineMessages({

Wyświetl plik

@ -8,8 +8,7 @@ import { logIn, verifyCredentials } from 'soapbox/actions/auth';
import { fetchInstance } from 'soapbox/actions/instance';
import { startOnboarding } from 'soapbox/actions/onboarding';
import snackbar from 'soapbox/actions/snackbar';
import { createAccount } from 'soapbox/actions/verification';
import { removeStoredVerification } from 'soapbox/actions/verification';
import { createAccount, removeStoredVerification } from 'soapbox/actions/verification';
import { Button, Form, FormGroup, Input } from 'soapbox/components/ui';
import { useAppSelector } from 'soapbox/hooks';
import { getRedirectUrl } from 'soapbox/utils/redirect';

Wyświetl plik

@ -4,8 +4,7 @@ import { useIntl } from 'react-intl';
import { useDispatch, useSelector } from 'react-redux';
import snackbar from 'soapbox/actions/snackbar';
import { checkEmailVerification, requestEmailVerification } from 'soapbox/actions/verification';
import { postEmailVerification } from 'soapbox/actions/verification';
import { checkEmailVerification, postEmailVerification, requestEmailVerification } from 'soapbox/actions/verification';
import Icon from 'soapbox/components/icon';
import { Button, Form, FormGroup, Input, Text } from 'soapbox/components/ui';

Wyświetl plik

@ -11,10 +11,10 @@ import {
ACCOUNT_MUTE_SUCCESS,
} from '../actions/accounts';
import {
CONTEXT_FETCH_SUCCESS,
STATUS_CREATE_REQUEST,
STATUS_CREATE_SUCCESS,
} from '../actions/statuses';
import { CONTEXT_FETCH_SUCCESS } from '../actions/statuses';
import { TIMELINE_DELETE } from '../actions/timelines';
import type { ReducerStatus } from './statuses';