Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

feat: remove unused imports and update prettier #8336

Merged
merged 1 commit into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 2 additions & 4 deletions .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
"arrowParens": "always",
"proseWrap": "never",
"endOfLine": "lf",
"importOrder": ["<THIRD_PARTY_MODULES>", "^@etherealengine/(.*)$", "^@mui/(.*)$", "^[./]"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true,
"importOrderCaseInsensitive": true
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some options removed by v4.0.0 's breaking changes here

"importOrder": ["<THIRD_PARTY_MODULES>", "", "^@etherealengine/(.*)$", "", "^@mui/(.*)$", "", "^[./]"],
"plugins": ["@ianvs/prettier-plugin-sort-imports", "prettier-plugin-organize-imports"]
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
]
},
"devDependencies": {
"@ianvs/prettier-plugin-sort-imports": "3.7.1",
"@ianvs/prettier-plugin-sort-imports": "4.1.0",
"@swc/core": "^1.3.41",
"@types/app-root-path": "1.2.4",
"@types/cli": "0.11.21",
Expand All @@ -117,7 +117,7 @@
"no-master-commits": "1.1.1",
"package-json-type": "1.0.3",
"pre-commit": "1.2.2",
"prettier": "2.8.6",
"prettier": "^3.0.0",
"react-dnd": "16.0.1",
"react-router-dom": "6.9.0",
"rimraf": "4.4.0",
Expand All @@ -138,6 +138,7 @@
"dotenv": "16.0.3",
"fix-esm": "^1.0.1",
"patch-package": "^6.5.1",
"prettier-plugin-organize-imports": "^3.2.3",
"three": "0.153.0",
"ts-node": "10.9.1",
"typescript": "5.0.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import React, { useEffect } from 'react'

import { getMutableState, useHookstate } from '@etherealengine/hyperflux'
import Box from '@etherealengine/ui/src/primitives/mui/Box'
import TextField from '@etherealengine/ui/src/primitives/mui/TextField'
import ToggleButton from '@etherealengine/ui/src/primitives/mui/ToggleButton'
import ToggleButtonGroup from '@etherealengine/ui/src/primitives/mui/ToggleButtonGroup'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import { AssetLoader } from '@etherealengine/engine/src/assets/classes/AssetLoad
import { AvatarRigComponent } from '@etherealengine/engine/src/avatar/components/AvatarAnimationComponent'
import { getOptionalComponent } from '@etherealengine/engine/src/ecs/functions/ComponentFunctions'
import { AvatarType } from '@etherealengine/engine/src/schemas/user/avatar.schema'
import { dispatchAction, getMutableState, useHookstate } from '@etherealengine/hyperflux'
import { getMutableState, useHookstate } from '@etherealengine/hyperflux'
import Box from '@etherealengine/ui/src/primitives/mui/Box'
import Button from '@etherealengine/ui/src/primitives/mui/Button'
import Container from '@etherealengine/ui/src/primitives/mui/Container'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ import Checkbox from '@etherealengine/ui/src/primitives/mui/Checkbox'
import { AuthState } from '../../../user/services/AuthService'
import TableComponent from '../../common/Table'
import { AvatarColumn, avatarColumns, AvatarData } from '../../common/variables/avatar'
import { AVATAR_PAGE_LIMIT } from '../../services/AvatarService'
import { AdminAvatarState } from '../../services/AvatarService'
import { AdminAvatarService } from '../../services/AvatarService'
import { AdminAvatarService, AdminAvatarState, AVATAR_PAGE_LIMIT } from '../../services/AvatarService'
import styles from '../../styles/admin.module.scss'
import AvatarDrawer, { AvatarDrawerMode } from './AvatarDrawer'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ import { useTranslation } from 'react-i18next'

import InputSelect, { InputMenuItem } from '@etherealengine/client-core/src/common/components/InputSelect'
import InputText from '@etherealengine/client-core/src/common/components/InputText'
import { CreateBotAsAdmin } from '@etherealengine/common/src/interfaces/AdminBot'
import { AdminBot } from '@etherealengine/common/src/interfaces/AdminBot'
import { AdminBot, CreateBotAsAdmin } from '@etherealengine/common/src/interfaces/AdminBot'
import { Instance } from '@etherealengine/common/src/interfaces/Instance'
import { getMutableState, useHookstate } from '@etherealengine/hyperflux'
import Button from '@etherealengine/ui/src/primitives/mui/Button'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ All portions of the code written by the Ethereal Engine team are Copyright © 20
Ethereal Engine. All Rights Reserved.
*/

import React, { useEffect, useRef } from 'react'
import React, { useEffect } from 'react'
import { useTranslation } from 'react-i18next'

import ConfirmDialog from '@etherealengine/client-core/src/common/components/ConfirmDialog'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import Icon from '@etherealengine/ui/src/primitives/mui/Icon'
import IconButton from '@etherealengine/ui/src/primitives/mui/IconButton'
import Tab from '@etherealengine/ui/src/primitives/mui/Tab'
import Tabs from '@etherealengine/ui/src/primitives/mui/Tabs'
import TextField from '@etherealengine/ui/src/primitives/mui/TextField'

import { DateTimePicker, LocalizationProvider } from '@mui/x-date-pickers'
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import Icon from '@etherealengine/ui/src/primitives/mui/Icon'
import IconButton from '@etherealengine/ui/src/primitives/mui/IconButton'
import Tab from '@etherealengine/ui/src/primitives/mui/Tab'
import Tabs from '@etherealengine/ui/src/primitives/mui/Tabs'
import TextField from '@etherealengine/ui/src/primitives/mui/TextField'

import { DateTimePicker, LocalizationProvider } from '@mui/x-date-pickers'
import { AdapterDateFns } from '@mui/x-date-pickers/AdapterDateFns'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Ethereal Engine. All Rights Reserved.

import React, { ReactElement, useEffect } from 'react'
import { useTranslation } from 'react-i18next'
import { Link } from 'react-router-dom'

import ConfirmDialog from '@etherealengine/client-core/src/common/components/ConfirmDialog'
import { Location } from '@etherealengine/common/src/interfaces/Location'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { useHookstate } from '@hookstate/core'
import React, { useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'

import InputSelect, { InputMenuItem } from '@etherealengine/client-core/src/common/components/InputSelect'
import InputText from '@etherealengine/client-core/src/common/components/InputText'
import { Party } from '@etherealengine/common/src/interfaces/Party'
import { getMutableState } from '@etherealengine/hyperflux'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,9 +484,9 @@ const ProjectFields = ({ inputProject, existingProject = false, changeDestinatio
{!processing &&
!projectUpdateStatus.value?.commitsProcessing &&
projectUpdateStatus.value?.sourceProjectName.length > 0 && (
<div className={styles.projectVersion}>{`${t('admin:components.project.sourceProjectName')}: ${
projectUpdateStatus.value?.sourceProjectName
}`}</div>
<div className={styles.projectVersion}>{`${t(
'admin:components.project.sourceProjectName'
)}: ${projectUpdateStatus.value?.sourceProjectName}`}</div>
)}

{projectUpdateStatus.value?.branchProcessing && (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ All portions of the code written by the Ethereal Engine team are Copyright © 20
Ethereal Engine. All Rights Reserved.
*/

import _ from 'lodash'
import React, { useEffect, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'

Expand Down
2 changes: 0 additions & 2 deletions packages/client-core/src/admin/components/Project/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ Ethereal Engine. All Rights Reserved.
import React, { useEffect } from 'react'
import { useTranslation } from 'react-i18next'

import { PresentationSystemGroup } from '@etherealengine/engine/src/ecs/functions/EngineFunctions'
import { useSystem } from '@etherealengine/engine/src/ecs/functions/SystemFunctions'
import { getMutableState, useHookstate } from '@etherealengine/hyperflux'
import Box from '@etherealengine/ui/src/primitives/mui/Box'
import Button from '@etherealengine/ui/src/primitives/mui/Button'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { useTranslation } from 'react-i18next'

import InputFile from '@etherealengine/client-core/src/common/components/InputFile'
import InputRadio from '@etherealengine/client-core/src/common/components/InputRadio'
import InputSelect, { InputMenuItem } from '@etherealengine/client-core/src/common/components/InputSelect'
import InputText from '@etherealengine/client-core/src/common/components/InputText'
import { MAX_AVATAR_FILE_SIZE, MIN_AVATAR_FILE_SIZE } from '@etherealengine/common/src/constants/AvatarConstants'
import { StaticResourceInterface } from '@etherealengine/common/src/interfaces/StaticResourceInterface'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,12 @@ const ServerLogs = () => {

useEffect(() => {
if (autoRefresh.value !== '0') {
const interval = setInterval(() => {
handleRefreshServerLogs()
}, parseInt(autoRefresh.value) * 1000)
const interval = setInterval(
() => {
handleRefreshServerLogs()
},
parseInt(autoRefresh.value) * 1000
)
intervalTimer.set(interval)
return () => {
if (interval) clearInterval(interval) // This represents the unmount function, in which you need to clear your interval to prevent memory leaks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,12 @@ const ServerTable = ({ selectedCard }: Props) => {

useEffect(() => {
if (autoRefresh.value !== '0') {
const interval = setInterval(() => {
handleRefreshServerInfo()
}, parseInt(autoRefresh.value) * 1000)
const interval = setInterval(
() => {
handleRefreshServerInfo()
},
parseInt(autoRefresh.value) * 1000
)
intervalTimer.set(interval)
return () => {
if (interval) clearInterval(interval) // This represents the unmount function, in which you need to clear your interval to prevent memory leaks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import { useTranslation } from 'react-i18next'
import InputText from '@etherealengine/client-core/src/common/components/InputText'
import { getMutableState, useHookstate } from '@etherealengine/hyperflux'
import Box from '@etherealengine/ui/src/primitives/mui/Box'
import Button from '@etherealengine/ui/src/primitives/mui/Button'
import Grid from '@etherealengine/ui/src/primitives/mui/Grid'
import Typography from '@etherealengine/ui/src/primitives/mui/Typography'

Expand Down
4 changes: 0 additions & 4 deletions packages/client-core/src/admin/components/Setting/Helm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ Ethereal Engine. All Rights Reserved.
import React, { useEffect } from 'react'
import { useTranslation } from 'react-i18next'

import InputSwitch from '@etherealengine/client-core/src/common/components/InputSwitch'
import InputText from '@etherealengine/client-core/src/common/components/InputText'
import { AwsCloudFrontType, AwsSmsType } from '@etherealengine/engine/src/schemas/setting/aws-setting.schema'
import { getMutableState, useHookstate } from '@etherealengine/hyperflux'
import Box from '@etherealengine/ui/src/primitives/mui/Box'
import Button from '@etherealengine/ui/src/primitives/mui/Button'
Expand All @@ -37,7 +34,6 @@ import Typography from '@etherealengine/ui/src/primitives/mui/Typography'

import InputSelect, { InputMenuItem } from '../../../common/components/InputSelect'
import { AuthState } from '../../../user/services/AuthService'
import { AwsSettingService } from '../../services/Setting/AwsSettingService'
import { AdminHelmSettingsState, HelmSettingService } from '../../services/Setting/HelmSettingService'
import styles from '../../styles/settings.module.scss'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,8 @@ import Tooltip from '@etherealengine/ui/src/primitives/mui/Tooltip'
import Typography from '@etherealengine/ui/src/primitives/mui/Typography'

import { DiscordIcon } from '../../../common/components/Icons/DiscordIcon'
import { FacebookIcon } from '../../../common/components/Icons/FacebookIcon'
import { GoogleIcon } from '../../../common/components/Icons/GoogleIcon'
import { LinkedInIcon } from '../../../common/components/Icons/LinkedInIcon'
import { TwitterIcon } from '../../../common/components/Icons/TwitterIcon'
import { NotificationService } from '../../../common/services/NotificationService'
import { AuthState } from '../../../user/services/AuthService'
import DrawerView from '../../common/DrawerView'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ All portions of the code written by the Ethereal Engine team are Copyright © 20
Ethereal Engine. All Rights Reserved.
*/

import { Paginated } from '@feathersjs/feathers'

import { matches, Validator } from '@etherealengine/engine/src/common/functions/MatchesUtils'
import { buildStatusPath, BuildStatusType } from '@etherealengine/engine/src/schemas/cluster/build-status.schema'
import { defineAction, defineState, dispatchAction, getMutableState } from '@etherealengine/hyperflux'
Expand Down
3 changes: 1 addition & 2 deletions packages/client-core/src/admin/services/RouteService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ import { Paginated } from '@feathersjs/feathers'

import { InstalledRoutesInterface } from '@etherealengine/common/src/interfaces/Route'
import { Engine } from '@etherealengine/engine/src/ecs/classes/Engine'
import { defineState, getMutableState, getState } from '@etherealengine/hyperflux'
import { defineState, getMutableState } from '@etherealengine/hyperflux'

import { NotificationService } from '../../common/services/NotificationService'
import { AuthState } from '../../user/services/AuthService'
import { userIsAdmin } from '../../user/userHasAccess'

export const ROUTE_PAGE_LIMIT = 10000
Expand Down
2 changes: 1 addition & 1 deletion packages/client-core/src/admin/services/SceneService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Ethereal Engine. All Rights Reserved.
*/

import { SceneData, SceneMetadata } from '@etherealengine/common/src/interfaces/SceneInterface'
import { matches, Validator } from '@etherealengine/engine/src/common/functions/MatchesUtils'
import { Validator, matches } from '@etherealengine/engine/src/common/functions/MatchesUtils'
import { defineAction, defineState, dispatchAction, getMutableState } from '@etherealengine/hyperflux'

import { API } from '../../API'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import { Engine } from '@etherealengine/engine/src/ecs/classes/Engine'
import {
helmBuilderVersionPath,
helmMainVersionPath,
HelmSettingPatch,
helmSettingPath,
HelmSettingType
} from '@etherealengine/engine/src/schemas/setting/helm-setting.schema'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ Ethereal Engine. All Rights Reserved.
*/

import { SnackbarKey, useSnackbar } from 'notistack'
import { Fragment } from 'react'
import React from 'react'
import React, { Fragment } from 'react'

import Icon from '@etherealengine/ui/src/primitives/mui/Icon'
import IconButton from '@etherealengine/ui/src/primitives/mui/IconButton'
Expand Down
10 changes: 2 additions & 8 deletions packages/client-core/src/common/services/AppService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,8 @@ All portions of the code written by the Ethereal Engine team are Copyright © 20
Ethereal Engine. All Rights Reserved.
*/

import { matches, Validator } from '@etherealengine/engine/src/common/functions/MatchesUtils'
import {
defineAction,
defineState,
getMutableState,
syncStateWithLocalStorage,
useState
} from '@etherealengine/hyperflux'
import { matches } from '@etherealengine/engine/src/common/functions/MatchesUtils'
import { defineAction, defineState, getMutableState, syncStateWithLocalStorage } from '@etherealengine/hyperflux'

export const AppState = defineState({
name: 'AppState',
Expand Down
19 changes: 4 additions & 15 deletions packages/client-core/src/common/services/AppThemeState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,12 @@ All portions of the code written by the Ethereal Engine team are Copyright © 20
Ethereal Engine. All Rights Reserved.
*/

import { useEffect } from 'react'

import { defaultThemeSettings, getCurrentTheme } from '@etherealengine/common/src/constants/DefaultThemeSettings'
import { matches, Validator } from '@etherealengine/engine/src/common/functions/MatchesUtils'
import { Validator, matches } from '@etherealengine/engine/src/common/functions/MatchesUtils'
import { ClientThemeOptionsType } from '@etherealengine/engine/src/schemas/setting/client-setting.schema'
import {
addActionReceptor,
defineAction,
defineState,
getMutableState,
getState,
NO_PROXY,
removeActionReceptor,
useHookstate
} from '@etherealengine/hyperflux'

import { AdminClientSettingsState, ClientSettingService } from '../../admin/services/Setting/ClientSettingService'
import { defineAction, defineState, getMutableState, getState, useHookstate } from '@etherealengine/hyperflux'

import { AdminClientSettingsState } from '../../admin/services/Setting/ClientSettingService'
import { AuthState } from '../../user/services/AuthService'

export const AppThemeState = defineState({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { Paginated } from '@feathersjs/feathers/lib'

import { FileContentType } from '@etherealengine/common/src/interfaces/FileContentType'
import { matches, Validator } from '@etherealengine/engine/src/common/functions/MatchesUtils'
import { defineAction, defineState, dispatchAction, getMutableState, useState } from '@etherealengine/hyperflux'
import { defineAction, defineState, dispatchAction, getMutableState } from '@etherealengine/hyperflux'

import { API } from '../../API'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ import {
} from '@etherealengine/hyperflux'

import { API } from '../../API'
import { leaveNetwork } from '../../transports/SocketWebRTCClientFunctions'
import {
connectToNetwork,
initializeNetwork,
leaveNetwork,
SocketWebRTCClientNetwork
} from '../../transports/SocketWebRTCClientFunctions'
import { AuthState } from '../../user/services/AuthService'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ import {

import { ChatState } from '../../social/services/ChatService'
import { LocationState } from '../../social/services/LocationService'
import { endVideoChat, leaveNetwork } from '../../transports/SocketWebRTCClientFunctions'
import {
connectToNetwork,
endVideoChat,
initializeNetwork,
leaveNetwork,
SocketWebRTCClientNetwork
} from '../../transports/SocketWebRTCClientFunctions'
import { AuthState } from '../../user/services/AuthService'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Ethereal Engine. All Rights Reserved.
import { OEmbed } from '@etherealengine/common/src/interfaces/OEmbed'
import multiLogger from '@etherealengine/common/src/logger'
import { matches, Validator } from '@etherealengine/engine/src/common/functions/MatchesUtils'
import { defineAction, defineState, dispatchAction, getMutableState, useState } from '@etherealengine/hyperflux'
import { defineAction, defineState, dispatchAction, getMutableState } from '@etherealengine/hyperflux'

import { API } from '../../API'
import { NotificationService } from './NotificationService'
Expand Down
4 changes: 2 additions & 2 deletions packages/client-core/src/common/services/ProjectService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import { BuilderTag } from '@etherealengine/common/src/interfaces/BuilderTags'
import { ProjectInterface, ProjectUpdateType } from '@etherealengine/common/src/interfaces/ProjectInterface'
import { UpdateProjectInterface } from '@etherealengine/common/src/interfaces/UpdateProjectInterface'
import multiLogger from '@etherealengine/common/src/logger'
import { matches, Validator } from '@etherealengine/engine/src/common/functions/MatchesUtils'
import { Validator, matches } from '@etherealengine/engine/src/common/functions/MatchesUtils'
import { githubRepoAccessRefreshPath } from '@etherealengine/engine/src/schemas/user/github-repo-access-refresh.schema'
import { defineAction, defineState, dispatchAction, getMutableState, useState } from '@etherealengine/hyperflux'
import { defineAction, defineState, dispatchAction, getMutableState } from '@etherealengine/hyperflux'

import { API } from '../../API'
import { NotificationService } from './NotificationService'
Expand Down
7 changes: 2 additions & 5 deletions packages/client-core/src/common/services/RouterService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ import i18n from 'i18next'
import { lazy, useEffect } from 'react'
import { useNavigate } from 'react-router-dom'

import { ROUTE_PAGE_LIMIT } from '@etherealengine/client-core/src/admin/services/RouteService'
import { API } from '@etherealengine/client-core/src/API'
import { matches, Validator } from '@etherealengine/engine/src/common/functions/MatchesUtils'
import { matches } from '@etherealengine/engine/src/common/functions/MatchesUtils'
import { Engine } from '@etherealengine/engine/src/ecs/classes/Engine'
import { routePath } from '@etherealengine/engine/src/schemas/route/route.schema'
import {
Expand All @@ -40,8 +38,7 @@ import {
getMutableState,
NO_PROXY,
removeActionReceptor,
useHookstate,
useState
useHookstate
} from '@etherealengine/hyperflux'
import { loadRoute } from '@etherealengine/projects/loadRoute'

Expand Down
Loading
Loading