pl-fe: lint

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak
2024-08-28 14:48:35 +02:00
parent fc611ed442
commit 0ddf6f2768
21 changed files with 22 additions and 22 deletions

View File

@ -1,7 +1,7 @@
import { staticFetch } from '../api';
import type { AnyAction } from 'redux';
import type { RootState } from 'pl-fe/store';
import type { AnyAction } from 'redux';
const FETCH_ABOUT_PAGE_REQUEST = 'FETCH_ABOUT_PAGE_REQUEST' as const;
const FETCH_ABOUT_PAGE_SUCCESS = 'FETCH_ABOUT_PAGE_SUCCESS' as const;

View File

@ -1,7 +1,7 @@
import { getClient } from '../api';
import type { AnyAction } from 'redux';
import type { RootState } from 'pl-fe/store';
import type { AnyAction } from 'redux';
const ACCOUNT_NOTE_SUBMIT_REQUEST = 'ACCOUNT_NOTE_SUBMIT_REQUEST' as const;
const ACCOUNT_NOTE_SUBMIT_SUCCESS = 'ACCOUNT_NOTE_SUBMIT_SUCCESS' as const;

View File

@ -10,10 +10,10 @@ import { getSettings } from './settings';
import { deleteFromTimelines } from './timelines';
import type { CreateStatusParams, Status as BaseStatus } from 'pl-api';
import type { IntlShape } from 'react-intl';
import type { Status } from 'pl-fe/normalizers';
import type { AppDispatch, RootState } from 'pl-fe/store';
import type { APIEntity } from 'pl-fe/types/entities';
import type { IntlShape } from 'react-intl';
const STATUS_CREATE_REQUEST = 'STATUS_CREATE_REQUEST' as const;
const STATUS_CREATE_SUCCESS = 'STATUS_CREATE_SUCCESS' as const;

View File

@ -197,7 +197,7 @@ const StatusContent: React.FC<IStatusContent> = React.memo(({
theme='muted'
size='xs'
onClick={toggleExpanded}
icon={expanded ? require('@tabler/icons/outline/chevron-up.svg') : require('@tabler/icons/outline/chevron-down.svg')}
icon={expanded ? require('@tabler/icons/outline/chevron-up.svg') : require('@tabler/icons/outline/chevron-down.svg')}
>
{intl.formatMessage(expanded ? messages.collapse : messages.expand)}
</Button>

View File

@ -14,8 +14,8 @@ import { usePlFeConfig } from 'pl-fe/hooks';
import { Stack, Text } from './ui';
import type { OrderedSet as ImmutableOrderedSet } from 'immutable';
import type { VirtuosoHandle } from 'react-virtuoso';
import type { IScrollableList } from 'pl-fe/components/scrollable-list';
import type { VirtuosoHandle } from 'react-virtuoso';
interface IStatusList extends Omit<IScrollableList, 'onLoadMore' | 'children'> {
/** Unique key to preserve the scroll position when navigating back. */

View File

@ -18,8 +18,8 @@ import PlaceholderHashtag from 'pl-fe/features/placeholder/components/placeholde
import PlaceholderStatus from 'pl-fe/features/placeholder/components/placeholder-status';
import { useAppDispatch, useAppSelector, useFeatures } from 'pl-fe/hooks';
import type { VirtuosoHandle } from 'react-virtuoso';
import type { SearchFilter } from 'pl-fe/reducers/search';
import type { VirtuosoHandle } from 'react-virtuoso';
const messages = defineMessages({
accounts: { id: 'search_results.accounts', defaultMessage: 'People' },
@ -216,7 +216,7 @@ const SearchResults = () => {
searchResults = ImmutableList(trendingLinks.map(trendingLink => <TrendingLink trendingLink={trendingLink} />));
}
}
return (
<>
{filterByAccount ? (

View File

@ -20,8 +20,8 @@ import { useAppDispatch, useAppSelector, useSettings } from 'pl-fe/hooks';
import FilterBar from './components/filter-bar';
import Notification from './components/notification';
import type { VirtuosoHandle } from 'react-virtuoso';
import type { RootState } from 'pl-fe/store';
import type { VirtuosoHandle } from 'react-virtuoso';
const messages = defineMessages({
title: { id: 'column.notifications', defaultMessage: 'Notifications' },

View File

@ -24,9 +24,9 @@ import { textForScreenReader } from 'pl-fe/utils/status';
import DetailedStatus from './detailed-status';
import ThreadStatus from './thread-status';
import type { VirtuosoHandle } from 'react-virtuoso';
import type { Account, Status } from 'pl-fe/normalizers';
import type { SelectedStatus } from 'pl-fe/selectors';
import type { VirtuosoHandle } from 'react-virtuoso';
const getAncestorsIds = createSelector([
(_: RootState, statusId: string | undefined) => statusId,

View File

@ -17,8 +17,8 @@ import { queryClient } from 'pl-fe/queries/client';
import { default as rootReducer } from '../reducers';
import type { AnyAction } from 'redux';
import type { AppDispatch } from 'pl-fe/store';
import type { AnyAction } from 'redux';
// Mock Redux
// https://redux.js.org/recipes/writing-tests/

View File

@ -1,8 +1,8 @@
import { play, soundCache } from 'pl-fe/utils/sounds';
import type { AnyAction, Middleware } from 'redux';
import type { Sounds } from 'pl-fe/utils/sounds';
import type { AnyAction, Middleware } from 'redux';
interface Action extends AnyAction {
meta: {

View File

@ -11,8 +11,8 @@ import {
} from 'pl-fe/actions/admin';
import type { AdminAccount, AdminGetAccountsParams, PaginatedResponse } from 'pl-api';
import type { AnyAction } from 'redux';
import type { APIEntity } from 'pl-fe/types/entities';
import type { AnyAction } from 'redux';
const ReducerRecord = ImmutableRecord({
isLoading: false,

View File

@ -22,8 +22,8 @@ import {
import { normalizeAdminReport, type AdminReport } from 'pl-fe/normalizers';
import type { AdminAccount, AdminGetAccountsParams, AdminReport as BaseAdminReport } from 'pl-api';
import type { AnyAction } from 'redux';
import type { Config } from 'pl-fe/utils/config-db';
import type { AnyAction } from 'redux';
const ReducerRecord = ImmutableRecord({
reports: ImmutableMap<string, MinifiedReport>(),

View File

@ -18,9 +18,9 @@ import {
} from '../actions/auth';
import { ME_FETCH_SKIP } from '../actions/me';
import type { AnyAction } from 'redux';
import type { PlfeResponse } from 'pl-fe/api';
import type { Account as AccountEntity } from 'pl-fe/normalizers';
import type { AnyAction } from 'redux';
const backendUrl = (isURL(BuildConfig.BACKEND_URL) ? BuildConfig.BACKEND_URL : '');

View File

@ -5,9 +5,9 @@ import { DRAFT_STATUSES_FETCH_SUCCESS, PERSIST_DRAFT_STATUS, CANCEL_DRAFT_STATUS
import KVStore from 'pl-fe/storage/kv-store';
import type { MediaAttachment } from 'pl-api';
import type { AnyAction } from 'redux';
import type { StatusVisibility } from 'pl-fe/normalizers/status';
import type { APIEntity } from 'pl-fe/types/entities';
import type { AnyAction } from 'redux';
const DraftStatusRecord = ImmutableRecord({
content_type: 'text/plain',

View File

@ -34,6 +34,7 @@ import mutes from './mutes';
import notifications from './notifications';
import onboarding from './onboarding';
import pending_statuses from './pending-statuses';
import plfe from './pl-fe';
import polls from './polls';
import profile_hover_card from './profile-hover-card';
import push_notifications from './push-notifications';
@ -44,7 +45,6 @@ import search from './search';
import security from './security';
import settings from './settings';
import sidebar from './sidebar';
import plfe from './pl-fe';
import status_hover_card from './status-hover-card';
import status_lists from './status-lists';
import statuses from './statuses';

View File

@ -10,9 +10,9 @@ import {
ME_PATCH_SUCCESS,
} from '../actions/me';
import type { AnyAction } from 'redux';
import type { PlfeResponse } from 'pl-fe/api';
import type { Me } from 'pl-fe/types/pl-fe';
import type { AnyAction } from 'redux';
const initialState: Me = null;

View File

@ -28,8 +28,8 @@ import {
import { TIMELINE_DELETE } from '../actions/timelines';
import type { AccountWarning, Notification as BaseNotification, Markers, PaginatedResponse, Relationship, RelationshipSeveranceEvent, Report } from 'pl-api';
import type { AnyAction } from 'redux';
import type { Notification } from 'pl-fe/normalizers';
import type { AnyAction } from 'redux';
const QueuedNotificationRecord = ImmutableRecord({
notification: {} as any as BaseNotification,

View File

@ -6,8 +6,8 @@ import {
STATUS_CREATE_SUCCESS,
} from 'pl-fe/actions/statuses';
import type { AnyAction } from 'redux';
import type { StatusVisibility } from 'pl-fe/normalizers/status';
import type { AnyAction } from 'redux';
const PendingStatusRecord = ImmutableRecord({
content_type: '',

View File

@ -16,8 +16,8 @@ import {
import { DOMAIN_BLOCK_SUCCESS, DOMAIN_UNBLOCK_SUCCESS } from '../actions/domain-blocks';
import { ACCOUNT_IMPORT, ACCOUNTS_IMPORT } from '../actions/importer';
import type { AnyAction } from 'redux';
import type { APIEntity } from 'pl-fe/types/entities';
import type { AnyAction } from 'redux';
type State = ImmutableMap<string, Relationship>;
type APIEntities = Array<APIEntity>;

View File

@ -25,8 +25,8 @@ import {
import type { Status } from '../normalizers';
import type { PaginatedResponse, Status as BaseStatus, Relationship } from 'pl-api';
import type { AnyAction } from 'redux';
import type { ImportPosition } from 'pl-fe/entity-store/types';
import type { AnyAction } from 'redux';
const TRUNCATE_LIMIT = 40;
const TRUNCATE_SIZE = 20;

View File

@ -1,7 +1,7 @@
import { isIntegerId } from 'pl-fe/utils/numbers';
import type { IntlShape } from 'react-intl';
import type { Status } from 'pl-fe/normalizers';
import type { IntlShape } from 'react-intl';
/** Get the initial visibility of media attachments from user settings. */
const defaultMediaVisibility = (