From 4f6ea71868f5c6881980e6796f943180be1fdb82 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Sat, 14 Sep 2024 18:31:44 -0400 Subject: [PATCH] fix: linting errors Signed-off-by: Adam Setch --- package.json | 17 +++-------------- src/components/AccountNotifications.tsx | 8 ++++---- src/components/Header.tsx | 4 ++-- src/components/NotificationRow.tsx | 2 +- src/components/ProductNotifications.test.tsx | 2 +- src/components/ProductNotifications.tsx | 2 +- src/components/Sidebar.tsx | 14 +++++++------- src/components/settings/AppearanceSettings.tsx | 2 +- .../settings/NotificationSettings.tsx | 4 ++-- src/components/settings/SettingsFooter.tsx | 6 +++--- src/components/settings/SystemSettings.tsx | 4 ++-- src/routes/Accounts.tsx | 4 ++-- src/routes/Filters.tsx | 6 +++--- src/routes/Login.tsx | 2 +- src/routes/LoginWithAPIToken.tsx | 4 ++-- src/utils/api/request.test.ts | 2 +- src/utils/notifications.ts | 2 +- 17 files changed, 37 insertions(+), 48 deletions(-) diff --git a/package.json b/package.json index 716b2dc9..4951f2ed 100644 --- a/package.json +++ b/package.json @@ -50,12 +50,7 @@ "build": { "appId": "com.electron.atlasify", "productName": "Atlasify", - "files": [ - "build/**/*", - "assets/**/*", - "src/electron/*", - "LICENSE" - ], + "files": ["build/**/*", "assets/**/*", "src/electron/*", "LICENSE"], "mac": { "category": "public.app-category.developer-tools", "icon": "assets/images/app-icon.icns", @@ -64,9 +59,7 @@ "gatekeeperAssess": false, "entitlements": "./entitlements/entitlements.mac.plist", "entitlementsInherit": "./entitlements/entitlements.mac.plist", - "publish": [ - "github" - ], + "publish": ["github"], "extendInfo": { "NSBluetoothAlwaysUsageDescription": null, "NSBluetoothPeripheralUsageDescription": null, @@ -86,11 +79,7 @@ "oneClick": false }, "linux": { - "target": [ - "AppImage", - "deb", - "rpm" - ], + "target": ["AppImage", "deb", "rpm"], "category": "Development", "maintainer": "Adam Setch" }, diff --git a/src/components/AccountNotifications.tsx b/src/components/AccountNotifications.tsx index 18d879c8..5360a293 100644 --- a/src/components/AccountNotifications.tsx +++ b/src/components/AccountNotifications.tsx @@ -1,12 +1,12 @@ import { type FC, type MouseEvent, useContext, useMemo, useState } from 'react'; -import Toggle from '@atlaskit/toggle'; -import Tooltip from '@atlaskit/tooltip'; +import Avatar from '@atlaskit/avatar'; +import { IconButton } from '@atlaskit/button/new'; import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down'; import ChevronLeftIcon from '@atlaskit/icon/glyph/chevron-left'; import ChevronUpIcon from '@atlaskit/icon/glyph/chevron-up'; -import { IconButton } from '@atlaskit/button/new'; -import Avatar from '@atlaskit/avatar'; +import Toggle from '@atlaskit/toggle'; +import Tooltip from '@atlaskit/tooltip'; import { AppContext } from '../context/App'; import { diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 9ec7fe9c..6eed8917 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -1,11 +1,11 @@ import { type FC, useContext } from 'react'; import { useNavigate } from 'react-router-dom'; +import { IconButton } from '@atlaskit/button/new'; import Heading from '@atlaskit/heading'; import ArrowLeftIcon from '@atlaskit/icon/glyph/arrow-left'; -import Tooltip from '@atlaskit/tooltip'; -import { IconButton } from '@atlaskit/button/new'; import { Inline } from '@atlaskit/primitives'; +import Tooltip from '@atlaskit/tooltip'; import { AppContext } from '../context/App'; diff --git a/src/components/NotificationRow.tsx b/src/components/NotificationRow.tsx index 19e93f55..65ed206b 100644 --- a/src/components/NotificationRow.tsx +++ b/src/components/NotificationRow.tsx @@ -1,9 +1,9 @@ import { type FC, useCallback, useContext, useState } from 'react'; import Avatar from '@atlaskit/avatar'; -import Tooltip from '@atlaskit/tooltip'; import { IconButton } from '@atlaskit/button/new'; import HipchatMediaAttachmentCountIcon from '@atlaskit/icon/glyph/hipchat/media-attachment-count'; +import Tooltip from '@atlaskit/tooltip'; import { AppContext } from '../context/App'; import { type AtlasifyNotification, Opacity } from '../types'; diff --git a/src/components/ProductNotifications.test.tsx b/src/components/ProductNotifications.test.tsx index 1cf479f4..912f336f 100644 --- a/src/components/ProductNotifications.test.tsx +++ b/src/components/ProductNotifications.test.tsx @@ -2,8 +2,8 @@ import { act, fireEvent, render, screen } from '@testing-library/react'; import { mockAtlassianCloudAccount } from '../__mocks__/state-mocks'; import { AppContext } from '../context/App'; import { mockAtlasifyNotification } from '../utils/api/__mocks__/response-mocks'; +import type { Product } from '../utils/api/types'; import { ProductNotifications } from './ProductNotifications'; -import { Product } from '../utils/api/types'; jest.mock('./NotificationRow', () => ({ NotificationRow: () =>
NotificationRow
, diff --git a/src/components/ProductNotifications.tsx b/src/components/ProductNotifications.tsx index bbb2e8b6..8f8f9cae 100644 --- a/src/components/ProductNotifications.tsx +++ b/src/components/ProductNotifications.tsx @@ -7,10 +7,10 @@ import HipchatMediaAttachmentCountIcon from '@atlaskit/icon/glyph/hipchat/media- import { AppContext } from '../context/App'; import { type AtlasifyNotification, Opacity } from '../types'; +import { markNotificationsAsRead } from '../utils/api/client'; import { cn } from '../utils/cn'; import { HoverGroup } from './HoverGroup'; import { NotificationRow } from './NotificationRow'; -import { markNotificationsAsRead } from '../utils/api/client'; interface IProductNotifications { productNotifications: AtlasifyNotification[]; diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index 9070440a..293a8c2c 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -2,16 +2,16 @@ import { type FC, useContext, useMemo } from 'react'; import { useLocation, useNavigate } from 'react-router-dom'; import Button, { IconButton } from '@atlaskit/button/new'; -import IssuesIcon from '@atlaskit/icon/glyph/issues'; import BitbucketPullrequestsIcon from '@atlaskit/icon/glyph/bitbucket/pullrequests'; -import { Stack, Text } from '@atlaskit/primitives'; -import Tooltip from '@atlaskit/tooltip'; -import { AtlasIcon } from '@atlaskit/logo'; -import NotificationIcon from '@atlaskit/icon/glyph/notification'; -import SettingsIcon from '@atlaskit/icon/glyph/settings'; +import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle'; import FilterIcon from '@atlaskit/icon/glyph/filter'; +import IssuesIcon from '@atlaskit/icon/glyph/issues'; +import NotificationIcon from '@atlaskit/icon/glyph/notification'; import RefreshIcon from '@atlaskit/icon/glyph/refresh'; -import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle'; +import SettingsIcon from '@atlaskit/icon/glyph/settings'; +import { AtlasIcon } from '@atlaskit/logo'; +import { Stack, Text } from '@atlaskit/primitives'; +import Tooltip from '@atlaskit/tooltip'; import { AppContext } from '../context/App'; import { quitApp } from '../utils/comms'; diff --git a/src/components/settings/AppearanceSettings.tsx b/src/components/settings/AppearanceSettings.tsx index 6e000129..3ea4fad5 100644 --- a/src/components/settings/AppearanceSettings.tsx +++ b/src/components/settings/AppearanceSettings.tsx @@ -9,11 +9,11 @@ import { Inline, Stack, Text } from '@atlaskit/primitives'; import { RadioGroup } from '@atlaskit/radio'; import type { OptionsPropType } from '@atlaskit/radio/types'; +import Heading from '@atlaskit/heading'; import { AppContext } from '../../context/App'; import { Theme } from '../../types'; import { setTheme } from '../../utils/theme'; import { zoomLevelToPercentage, zoomPercentageToLevel } from '../../utils/zoom'; -import Heading from '@atlaskit/heading'; let timeout: NodeJS.Timeout; const DELAY = 200; diff --git a/src/components/settings/NotificationSettings.tsx b/src/components/settings/NotificationSettings.tsx index 146f066c..1d526aba 100644 --- a/src/components/settings/NotificationSettings.tsx +++ b/src/components/settings/NotificationSettings.tsx @@ -1,14 +1,14 @@ import { type FC, useContext } from 'react'; import { Checkbox } from '@atlaskit/checkbox'; +import Heading from '@atlaskit/heading'; import { Inline, Stack, Text } from '@atlaskit/primitives'; import { RadioGroup } from '@atlaskit/radio'; import type { OptionsPropType } from '@atlaskit/radio/types'; -import Heading from '@atlaskit/heading'; +import InlineMessage from '@atlaskit/inline-message'; import { AppContext } from '../../context/App'; import { GroupBy } from '../../types'; -import InlineMessage from '@atlaskit/inline-message'; export const NotificationSettings: FC = () => { const { settings, updateSetting } = useContext(AppContext); diff --git a/src/components/settings/SettingsFooter.tsx b/src/components/settings/SettingsFooter.tsx index bddad9aa..6c077a95 100644 --- a/src/components/settings/SettingsFooter.tsx +++ b/src/components/settings/SettingsFooter.tsx @@ -1,14 +1,14 @@ import { type FC, useEffect, useState } from 'react'; import { useNavigate } from 'react-router-dom'; +import Button, { IconButton } from '@atlaskit/button/new'; import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle'; import PeopleGroupIcon from '@atlaskit/icon/glyph/people-group'; -import Button, { IconButton } from '@atlaskit/button/new'; +import { Box, Inline, Stack } from '@atlaskit/primitives'; +import Tooltip from '@atlaskit/tooltip'; import { getAppVersion, quitApp } from '../../utils/comms'; import { openAtlasifyReleaseNotes } from '../../utils/links'; -import Tooltip from '@atlaskit/tooltip'; -import { Box, Inline, Stack } from '@atlaskit/primitives'; export const SettingsFooter: FC = () => { const [appVersion, setAppVersion] = useState(null); diff --git a/src/components/settings/SystemSettings.tsx b/src/components/settings/SystemSettings.tsx index 61c2b10e..0e17ee7e 100644 --- a/src/components/settings/SystemSettings.tsx +++ b/src/components/settings/SystemSettings.tsx @@ -1,16 +1,16 @@ import { type FC, useContext } from 'react'; import { Checkbox } from '@atlaskit/checkbox'; +import Heading from '@atlaskit/heading'; import { Inline, Stack, Text } from '@atlaskit/primitives'; import { RadioGroup } from '@atlaskit/radio'; import type { OptionsPropType } from '@atlaskit/radio/types'; -import Heading from '@atlaskit/heading'; +import InlineMessage from '@atlaskit/inline-message'; import { AppContext } from '../../context/App'; import { OpenPreference } from '../../types'; import { Constants } from '../../utils/constants'; import { isLinux, isMacOS } from '../../utils/platform'; -import InlineMessage from '@atlaskit/inline-message'; export const SystemSettings: FC = () => { const { settings, updateSetting } = useContext(AppContext); diff --git a/src/routes/Accounts.tsx b/src/routes/Accounts.tsx index e95a007e..cd716d0d 100644 --- a/src/routes/Accounts.tsx +++ b/src/routes/Accounts.tsx @@ -2,6 +2,7 @@ import { type FC, useCallback, useContext } from 'react'; import { useNavigate } from 'react-router-dom'; import Avatar from '@atlaskit/avatar'; +import { IconButton } from '@atlaskit/button/new'; import InviteTeamIcon from '@atlaskit/icon/glyph/invite-team'; import LockIcon from '@atlaskit/icon/glyph/lock'; import PersonIcon from '@atlaskit/icon/glyph/person'; @@ -9,9 +10,8 @@ import RefreshIcon from '@atlaskit/icon/glyph/refresh'; import SignOutIcon from '@atlaskit/icon/glyph/sign-out'; import StarIcon from '@atlaskit/icon/glyph/star'; import StarFilledIcon from '@atlaskit/icon/glyph/star-filled'; -import Tooltip from '@atlaskit/tooltip'; -import { IconButton } from '@atlaskit/button/new'; import { Box, Flex, Inline } from '@atlaskit/primitives'; +import Tooltip from '@atlaskit/tooltip'; import { Header } from '../components/Header'; import { AppContext } from '../context/App'; diff --git a/src/routes/Filters.tsx b/src/routes/Filters.tsx index e2fec0d9..eb759b38 100644 --- a/src/routes/Filters.tsx +++ b/src/routes/Filters.tsx @@ -1,9 +1,9 @@ import { type FC, useContext } from 'react'; -import Checkbox from '@atlaskit/checkbox'; -import { Box, Flex, Stack } from '@atlaskit/primitives'; import Button from '@atlaskit/button/new'; +import Checkbox from '@atlaskit/checkbox'; import Heading from '@atlaskit/heading'; +import { Box, Flex, Stack } from '@atlaskit/primitives'; import { Header } from '../components/Header'; // import { Legend } from '../components/settings/Legend'; @@ -15,8 +15,8 @@ import { getCategoryDetails, getReadStateDetails, } from '../utils/filters'; -import { PRODUCTS, getProductDetails } from '../utils/product'; import { formatProperCase } from '../utils/helpers'; +import { PRODUCTS, getProductDetails } from '../utils/product'; export const FiltersRoute: FC = () => { const { settings, clearFilters, updateSetting } = useContext(AppContext); diff --git a/src/routes/Login.tsx b/src/routes/Login.tsx index 40d605be..cbe8a3e2 100644 --- a/src/routes/Login.tsx +++ b/src/routes/Login.tsx @@ -2,7 +2,6 @@ import { type FC, useContext, useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; import Button from '@atlaskit/button/new'; -import Tooltip from '@atlaskit/tooltip'; import NotificationAllIcon from '@atlaskit/icon/glyph/notification-all'; import { AtlassianIcon, @@ -13,6 +12,7 @@ import { JiraProductDiscoveryIcon, JiraServiceManagementIcon, } from '@atlaskit/logo'; +import Tooltip from '@atlaskit/tooltip'; import { AppContext } from '../context/App'; import { showWindow } from '../utils/comms'; diff --git a/src/routes/LoginWithAPIToken.tsx b/src/routes/LoginWithAPIToken.tsx index 87715056..d08c3e79 100644 --- a/src/routes/LoginWithAPIToken.tsx +++ b/src/routes/LoginWithAPIToken.tsx @@ -2,10 +2,10 @@ import log from 'electron-log'; import { type FC, useCallback, useContext, useState } from 'react'; import Button from '@atlaskit/button/new'; -import SignInIcon from '@atlaskit/icon/glyph/sign-in'; +import LockIcon from '@atlaskit/icon/glyph/lock'; import ShortcutIcon from '@atlaskit/icon/glyph/shortcut'; +import SignInIcon from '@atlaskit/icon/glyph/sign-in'; import Tooltip from '@atlaskit/tooltip'; -import LockIcon from '@atlaskit/icon/glyph/lock'; import { Form, type FormRenderProps } from 'react-final-form'; import { useNavigate } from 'react-router-dom'; diff --git a/src/utils/api/request.test.ts b/src/utils/api/request.test.ts index 600efeec..2303ad07 100644 --- a/src/utils/api/request.test.ts +++ b/src/utils/api/request.test.ts @@ -1,7 +1,7 @@ import axios from 'axios'; +import { mockAtlassianCloudAccount } from '../../__mocks__/state-mocks'; import type { Link } from '../../types'; import { apiRequestAuth } from './request'; -import { mockAtlassianCloudAccount } from '../../__mocks__/state-mocks'; jest.mock('axios'); diff --git a/src/utils/notifications.ts b/src/utils/notifications.ts index 541ba5f6..8c8719f3 100644 --- a/src/utils/notifications.ts +++ b/src/utils/notifications.ts @@ -11,10 +11,10 @@ import { determineFailureType } from './api/errors'; import type { AtlassianNotification, Category, ReadState } from './api/types'; import { getAccountUUID } from './auth/utils'; import { hideWindow, showWindow, updateTrayIcon } from './comms'; +import { READ_STATES } from './filters'; import { openNotification } from './links'; import { isWindows } from './platform'; import { getAtlassianProduct } from './product'; -import { READ_STATES } from './filters'; export function setTrayIconColor(notifications: AccountNotifications[]) { const allNotificationsCount = getNotificationCount(notifications);