Skip to content

Commit

Permalink
fix issue with prettier sort order contradicting eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
patosullivan committed Feb 16, 2024
1 parent 75e5637 commit 1ced489
Show file tree
Hide file tree
Showing 350 changed files with 1,361 additions and 1,013 deletions.
2 changes: 1 addition & 1 deletion apps/tlon-web/.prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module.exports = {
tailwindConfig: './tailwind.config.js',
semi: true,
trailingComma: 'es5',
importOrder: ['<THIRD_PARTY_MODULES>', '^[./]'],
importOrder: ['<THIRD_PARTY_MODULES>', '^@/(.*)', '^[./]'],
importOrderSeparation: true,
importOrderSortSpecifiers: true,
};
3 changes: 2 additions & 1 deletion apps/tlon-web/src/api.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/* eslint-disable import/no-cycle */
import { useLocalState } from '@/state/local';
import type UrbitMock from '@tloncorp/mock-http-api';
import UrbitBase, {
Message,
Expand All @@ -13,6 +12,8 @@ import UrbitBase, {
} from '@urbit/http-api';
import _ from 'lodash';

import { useLocalState } from '@/state/local';

import { actionDrill, isHosted, parseKind } from './logic/utils';
import { useEyreState } from './state/eyre';
import useSchedulerStore from './state/scheduler';
Expand Down
31 changes: 16 additions & 15 deletions apps/tlon-web/src/app.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
// Copyright 2022, Tlon Corporation
import { TooltipProvider } from '@radix-ui/react-tooltip';
import cookies from 'browser-cookies';
import { usePostHog } from 'posthog-js/react';
import React, { Suspense, useEffect, useMemo, useState } from 'react';
import { ErrorBoundary } from 'react-error-boundary';
import { Helmet } from 'react-helmet';
import {
Location,
NavigateFunction,
Route,
BrowserRouter as Router,
Routes,
useLocation,
useNavigate,
} from 'react-router-dom';

import { IS_MOCK } from '@/api';
import tlonFavicon from '@/assets/favicon.ico';
import NewChannelModal from '@/channels/NewChannel/NewChannelModal';
Expand Down Expand Up @@ -73,21 +89,6 @@ import {
useSettingsLoaded,
useTheme,
} from '@/state/settings';
import { TooltipProvider } from '@radix-ui/react-tooltip';
import cookies from 'browser-cookies';
import { usePostHog } from 'posthog-js/react';
import React, { Suspense, useEffect, useMemo, useState } from 'react';
import { ErrorBoundary } from 'react-error-boundary';
import { Helmet } from 'react-helmet';
import {
Location,
NavigateFunction,
Route,
BrowserRouter as Router,
Routes,
useLocation,
useNavigate,
} from 'react-router-dom';

import ChannelVolumeDialog from './channels/ChannelVolumeDialog';
import MobileChatSearch from './chat/ChatSearch/MobileChatSearch';
Expand Down
7 changes: 4 additions & 3 deletions apps/tlon-web/src/channels/ChannelActions.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import cn from 'classnames';
import React, { PropsWithChildren, useCallback, useState } from 'react';
import { useLocation, useNavigate } from 'react-router';

import ActionMenu, { Action } from '@/components/ActionMenu';
import useActiveTab from '@/components/Sidebar/util';
import VolumeSetting from '@/components/VolumeSetting';
Expand All @@ -10,9 +14,6 @@ import { useIsMobile } from '@/logic/useMedia';
import { getFlagParts, nestToFlag } from '@/logic/utils';
import { useDeleteChannelMutation, useRouteGroup } from '@/state/groups';
import { GroupChannel } from '@/types/groups';
import cn from 'classnames';
import React, { PropsWithChildren, useCallback, useState } from 'react';
import { useLocation, useNavigate } from 'react-router';

import ChannelHostConnection from './ChannelHostConnection';

Expand Down
5 changes: 3 additions & 2 deletions apps/tlon-web/src/channels/ChannelHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import cn from 'classnames';
import { PropsWithChildren } from 'react';

import MobileHeader from '@/components/MobileHeader';
import ReconnectingSpinner from '@/components/ReconnectingSpinner';
import { useIsMobile } from '@/logic/useMedia';
import { useAmAdmin, useGroupChannel } from '@/state/groups';
import cn from 'classnames';
import { PropsWithChildren } from 'react';

import ChannelActions, { ChannelActionsProps } from './ChannelActions';
import ChannelHostConnection from './ChannelHostConnection';
Expand Down
3 changes: 2 additions & 1 deletion apps/tlon-web/src/channels/ChannelIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import React from 'react';

import BubbleIcon from '@/components/icons/BubbleIcon';
import NotebookIcon from '@/components/icons/NotebookIcon';
import ShapesIcon from '@/components/icons/ShapesIcon';
import UnknownAvatarIcon from '@/components/icons/UnknownAvatarIcon';
import { nestToFlag } from '@/logic/utils';
import React from 'react';

interface ChannelIconProps extends React.HTMLAttributes<SVGElement> {
nest: string;
Expand Down
3 changes: 2 additions & 1 deletion apps/tlon-web/src/channels/ChannelSearch.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useParams } from 'react-router';

import ChatSearch, { ChatSearchProps } from '@/chat/ChatSearch/ChatSearch';
import { useChannelSearch } from '@/state/channel/channel';
import { useParams } from 'react-router';

export default function ChannelSearch(
props: Omit<ChatSearchProps, 'scan' | 'query' | 'isLoading' | 'endReached'>
Expand Down
3 changes: 2 additions & 1 deletion apps/tlon-web/src/channels/ChannelSortSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ChannelFormSchema } from '@/types/groups';
import { useFormContext } from 'react-hook-form';

import { ChannelFormSchema } from '@/types/groups';

interface SortSettingRowProps {
type: 'time' | 'arranged';
}
Expand Down
5 changes: 3 additions & 2 deletions apps/tlon-web/src/channels/ChannelTitleButton.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import cn from 'classnames';
import { Link } from 'react-router-dom';

import CaretLeft16Icon from '@/components/icons/CaretLeft16Icon';
import { useIsMobile } from '@/logic/useMedia';
import { useGroupChannel } from '@/state/groups';
import cn from 'classnames';
import { Link } from 'react-router-dom';

import ChannelHostConnection from './ChannelHostConnection';
import ChannelIcon from './ChannelIcon';
Expand Down
7 changes: 4 additions & 3 deletions apps/tlon-web/src/channels/ChannelTypeSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import cn from 'classnames';
import React from 'react';
import { useFormContext } from 'react-hook-form';

import BubbleIcon from '@/components/icons/BubbleIcon';
import NotebookIcon from '@/components/icons/NotebookIcon';
import ShapesIcon from '@/components/icons/ShapesIcon';
import { ChannelType, NewChannelFormSchema } from '@/types/groups';
import cn from 'classnames';
import React from 'react';
import { useFormContext } from 'react-hook-form';

interface ChannelTypeMetadata {
title: string;
Expand Down
3 changes: 2 additions & 1 deletion apps/tlon-web/src/channels/ChannelViewSelector.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ChannelFormSchema } from '@/types/groups';
import { useFormContext } from 'react-hook-form';

import { ChannelFormSchema } from '@/types/groups';

interface ViewSettingRowProps {
type: 'grid' | 'list';
}
Expand Down
5 changes: 3 additions & 2 deletions apps/tlon-web/src/channels/ChannelVolumeDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { Helmet } from 'react-helmet';
import { useParams } from 'react-router';

import Dialog from '@/components/Dialog';
import VolumeSetting from '@/components/VolumeSetting';
import { useDismissNavigate } from '@/logic/routing';
import { useGroupChannel, useRouteGroup } from '@/state/groups';
import { ViewProps } from '@/types/groups';
import { Helmet } from 'react-helmet';
import { useParams } from 'react-router';

export default function ChannelVolumeDialog({ title }: ViewProps) {
const { chType, chShip, chName } = useParams<{
Expand Down
5 changes: 3 additions & 2 deletions apps/tlon-web/src/channels/DisplayDropdown.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import * as Dropdown from '@radix-ui/react-dropdown-menu';
import cn from 'classnames';

import GridIcon from '@/components/icons/GridIcon';
import ListIcon from '@/components/icons/ListIcon';
import { DisplayMode } from '@/types/channel';
import * as Dropdown from '@radix-ui/react-dropdown-menu';
import cn from 'classnames';

interface DisplayDropdownProps {
displayMode: DisplayMode;
Expand Down
11 changes: 6 additions & 5 deletions apps/tlon-web/src/channels/EditChannelForm.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import * as DialogPrimitive from '@radix-ui/react-dialog';
import _ from 'lodash';
import React, { useCallback } from 'react';
import { FormProvider, useForm } from 'react-hook-form';
import { useNavigate } from 'react-router';

import LoadingSpinner from '@/components/LoadingSpinner/LoadingSpinner';
import ChannelPermsSelector from '@/groups/ChannelsList/ChannelPermsSelector';
import { channelHref, prettyChannelTypeName } from '@/logic/channel';
Expand All @@ -17,11 +23,6 @@ import {
} from '@/state/groups';
import { SortMode } from '@/types/channel';
import { ChannelFormSchema, GroupChannel } from '@/types/groups';
import * as DialogPrimitive from '@radix-ui/react-dialog';
import _ from 'lodash';
import React, { useCallback } from 'react';
import { FormProvider, useForm } from 'react-hook-form';
import { useNavigate } from 'react-router';

import ChannelSortSelector from './ChannelSortSelector';
import ChannelViewSelector from './ChannelViewSelector';
Expand Down
9 changes: 5 additions & 4 deletions apps/tlon-web/src/channels/NewChannel/NewChannelForm.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import * as DialogPrimitive from '@radix-ui/react-dialog';
import { useCallback } from 'react';
import { FormProvider, useForm } from 'react-hook-form';
import { useNavigate, useParams } from 'react-router';

import ChannelTypeSelector from '@/channels/ChannelTypeSelector';
import LoadingSpinner from '@/components/LoadingSpinner/LoadingSpinner';
import Tooltip from '@/components/Tooltip';
Expand All @@ -11,10 +16,6 @@ import {
useRouteGroup,
} from '@/state/groups';
import { NewChannelFormSchema } from '@/types/groups';
import * as DialogPrimitive from '@radix-ui/react-dialog';
import { useCallback } from 'react';
import { FormProvider, useForm } from 'react-hook-form';
import { useNavigate, useParams } from 'react-router';

export default function NewChannelForm() {
const { section } = useParams<{ section: string }>();
Expand Down
3 changes: 2 additions & 1 deletion apps/tlon-web/src/channels/NewChannel/NewChannelModal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';

import Dialog from '@/components/Dialog';
import { useDismissNavigate } from '@/logic/routing';
import React from 'react';

import NewChannelForm from './NewChannelForm';

Expand Down
11 changes: 6 additions & 5 deletions apps/tlon-web/src/chat/ChatChannel.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import cn from 'classnames';
import React, { useMemo, useRef } from 'react';
import { Helmet } from 'react-helmet';
import { Route, Routes, useMatch, useParams } from 'react-router';
import { Link, useSearchParams } from 'react-router-dom';

import ChannelHeader from '@/channels/ChannelHeader';
import ChannelSearch from '@/channels/ChannelSearch';
import ChannelTitleButton from '@/channels/ChannelTitleButton';
Expand All @@ -19,11 +25,6 @@ import {
} from '@/state/channel/channel';
import { useRouteGroup } from '@/state/groups/groups';
import { ViewProps } from '@/types/groups';
import cn from 'classnames';
import React, { useMemo, useRef } from 'react';
import { Helmet } from 'react-helmet';
import { Route, Routes, useMatch, useParams } from 'react-router';
import { Link, useSearchParams } from 'react-router-dom';

import ChatThread from './ChatThread/ChatThread';

Expand Down
11 changes: 6 additions & 5 deletions apps/tlon-web/src/chat/ChatContent/ChatContent.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
import cn from 'classnames';
import { findLastIndex } from 'lodash';
import React, { useEffect } from 'react';
import { useLocation } from 'react-router';
import { Link } from 'react-router-dom';

import ChatContentImage from '@/chat/ChatContent/ChatContentImage';
import ChatEmbedContent from '@/chat/ChatEmbedContent/ChatEmbedContent';
// eslint-disable-next-line import/no-cycle
Expand Down Expand Up @@ -25,11 +31,6 @@ import {
isShip,
isStrikethrough,
} from '@/types/content';
import cn from 'classnames';
import { findLastIndex } from 'lodash';
import React, { useEffect } from 'react';
import { useLocation } from 'react-router';
import { Link } from 'react-router-dom';

interface ChatContentProps {
story: Story;
Expand Down
5 changes: 3 additions & 2 deletions apps/tlon-web/src/chat/ChatContent/ChatContentImage.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React, { useState } from 'react';
import { useParams } from 'react-router';

import LightBox from '@/components/LightBox';
import ExclamationPoint from '@/components/icons/ExclamationPoint';
import { useCalm } from '@/state/settings';
import React, { useState } from 'react';
import { useParams } from 'react-router';

import { useChatDialog, useChatFailedToLoadContent } from '../useChatStore';

Expand Down
3 changes: 2 additions & 1 deletion apps/tlon-web/src/chat/ChatEmbedContent/AudioPlayer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import LightBox from '@/components/LightBox';
import React, {
MouseEvent,
useCallback,
Expand All @@ -8,6 +7,8 @@ import React, {
} from 'react';
import { useParams } from 'react-router';

import LightBox from '@/components/LightBox';

import { useChatDialog } from '../useChatStore';

function formatTime(num: number) {
Expand Down
7 changes: 4 additions & 3 deletions apps/tlon-web/src/chat/ChatEmbedContent/ChatEmbedContent.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import DOMPurify from 'dompurify';
import React, { useEffect } from 'react';
import { BigPlayButton, Player } from 'video-react';

import { useIsMobile } from '@/logic/useMedia';
import { AUDIO_REGEX, VIDEO_REGEX, validOembedCheck } from '@/logic/utils';
import { useEmbed } from '@/state/embed';
import { useCalm } from '@/state/settings';
import DOMPurify from 'dompurify';
import React, { useEffect } from 'react';
import { BigPlayButton, Player } from 'video-react';

import AudioPlayer from './AudioPlayer';
import SpotifyEmbed from './SpotifyEmbed';
Expand Down
5 changes: 3 additions & 2 deletions apps/tlon-web/src/chat/ChatEmbedContent/SpotifyEmbed.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import LightBox from '@/components/LightBox';
import CaretRightIcon from '@/components/icons/CaretRightIcon';
import React from 'react';
import { useParams } from 'react-router';

import LightBox from '@/components/LightBox';
import CaretRightIcon from '@/components/icons/CaretRightIcon';

import { useChatDialog } from '../useChatStore';

interface SpotifyEmbedProps {
Expand Down
3 changes: 2 additions & 1 deletion apps/tlon-web/src/chat/ChatEmbedContent/TwitterEmbed.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/* eslint-disable react/no-danger */
import TwitterXIcon from '@/components/icons/TwitterXIcon';
import DOMPurify from 'dompurify';
import { Tweet, useTweet } from 'react-tweet';

import TwitterXIcon from '@/components/icons/TwitterXIcon';

interface TwitterEmbedProps {
embedHtml: string;
}
Expand Down
5 changes: 3 additions & 2 deletions apps/tlon-web/src/chat/ChatEmbedContent/YouTubeEmbed.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from 'react';
import { useParams } from 'react-router';

import LightBox from '@/components/LightBox';
import CaretRightIcon from '@/components/icons/CaretRightIcon';
import { useIsMobile } from '@/logic/useMedia';
import React from 'react';
import { useParams } from 'react-router';

import { useChatDialog } from '../useChatStore';

Expand Down
27 changes: 14 additions & 13 deletions apps/tlon-web/src/chat/ChatInput/ChatInput.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
import * as Popover from '@radix-ui/react-popover';
import { Editor } from '@tiptap/react';
import cn from 'classnames';
import _, { debounce } from 'lodash';
import React, {
useCallback,
useEffect,
useMemo,
useRef,
useState,
} from 'react';
import { useSearchParams } from 'react-router-dom';
import { useLocalStorage } from 'usehooks-ts';

import {
chatStoreLogger,
fetchChatBlocks,
Expand Down Expand Up @@ -50,19 +64,6 @@ import {
ReplyTuple,
} from '@/types/channel';
import { WritTuple } from '@/types/dms';
import * as Popover from '@radix-ui/react-popover';
import { Editor } from '@tiptap/react';
import cn from 'classnames';
import _, { debounce } from 'lodash';
import React, {
useCallback,
useEffect,
useMemo,
useRef,
useState,
} from 'react';
import { useSearchParams } from 'react-router-dom';
import { useLocalStorage } from 'usehooks-ts';

interface ChatInputProps {
whom: string;
Expand Down
Loading

0 comments on commit 1ced489

Please sign in to comment.