diff --git a/gui/eslint.config.js b/gui/eslint.config.js index 02c2ca633..6d1948b42 100644 --- a/gui/eslint.config.js +++ b/gui/eslint.config.js @@ -103,6 +103,7 @@ export const gui = [ // stuff that should be enabled again later eqeqeq: 'off', 'no-nested-ternary': 'off', + 'no-await-in-loop': 'off', '@typescript-eslint/no-use-before-define': 'off', '@typescript-eslint/no-shadow': 'off', 'import-x/prefer-default-export': 'off', diff --git a/gui/src/components/BVHButton.tsx b/gui/src/components/BVHButton.tsx index c712d5073..2de03e091 100644 --- a/gui/src/components/BVHButton.tsx +++ b/gui/src/components/BVHButton.tsx @@ -6,12 +6,12 @@ import { RpcMessage, } from 'solarxr-protocol'; import { useWebsocketAPI } from '@/hooks/websocket-api'; -import { BigButton } from './commons/BigButton'; -import { RecordIcon } from './commons/icon/RecordIcon'; import classNames from 'classnames'; import { isTauri } from '@tauri-apps/api/core'; import { save } from '@tauri-apps/plugin-dialog'; import { useConfig } from '@/hooks/config'; +import { RecordIcon } from './commons/icon/RecordIcon'; +import { BigButton } from './commons/BigButton'; export function BVHButton({ className, diff --git a/gui/src/components/commons/TauriFileInput.tsx b/gui/src/components/commons/TauriFileInput.tsx index 97dd0d943..e78df557f 100644 --- a/gui/src/components/commons/TauriFileInput.tsx +++ b/gui/src/components/commons/TauriFileInput.tsx @@ -4,8 +4,8 @@ import { RefCallBack, UseControllerProps, } from 'react-hook-form'; -import { FileInputContentBlank, FileInputContentFile } from './FileInput'; import { open } from '@tauri-apps/plugin-dialog'; +import { FileInputContentBlank, FileInputContentFile } from './FileInput'; export function InnerTauriFileInput({ label, @@ -43,7 +43,7 @@ export function TauriFileInput({ control: Control; /** * Use a translation key! - **/ + * */ label: string; name: string; directory?: boolean; diff --git a/gui/src/components/firmware-tool/AddImusStep.tsx b/gui/src/components/firmware-tool/AddImusStep.tsx index c6b248894..9dabb3b70 100644 --- a/gui/src/components/firmware-tool/AddImusStep.tsx +++ b/gui/src/components/firmware-tool/AddImusStep.tsx @@ -237,72 +237,71 @@ export function AddImusStep({ }; return ( - <> -
-
- - {l10n.getString('firmware_tool-add_imus_step-description')} - -
-
- {!isAckchuallyLoading && imuTypes && newConfig && ( - <> -
-
1 - ? 'md:grid-cols-2 mobile-settings:grid-cols-1' - : 'grid-cols-1' - )} - > - {form.imus.map((imu, index) => ( - t == imu.type) - ?.hasIntPin ?? false - } - index={index} - onDelete={() => deleteImu(index)} - > - ))} -
-
- - - -
+
+
+ + {l10n.getString('firmware_tool-add_imus_step-description')} + +
+
+ {!isAckchuallyLoading && imuTypes && newConfig && ( + <> +
+
1 + ? 'md:grid-cols-2 mobile-settings:grid-cols-1' + : 'grid-cols-1' + )} + > + {form.imus.map((imu, index) => ( + t == imu.type) + ?.hasIntPin ?? false + } + index={index} + onDelete={() => deleteImu(index)} + /> + ))}
-
- - - - - +
+ +
- - )} - {isAckchuallyLoading && ( -
- - - +
+
+ +
- )} -
+ + )} + {isAckchuallyLoading && ( +
+ + + + +
+ )}
- +
); } diff --git a/gui/src/components/onboarding/pages/CalibrationTutorial.tsx b/gui/src/components/onboarding/pages/CalibrationTutorial.tsx index ca6aea197..5a3697f83 100644 --- a/gui/src/components/onboarding/pages/CalibrationTutorial.tsx +++ b/gui/src/components/onboarding/pages/CalibrationTutorial.tsx @@ -117,102 +117,100 @@ export function CalibrationTutorialPage() { applyProgress(0.43); return ( - <> -
-
-
-
-
- - {l10n.getString('onboarding-calibration_tutorial')} - - - {l10n.getString('onboarding-calibration_tutorial-subtitle')} - -
- }} - > - - Description on calibration of IMU - - -
-
-
- -
+
+
+
+
+
+ + {l10n.getString('onboarding-calibration_tutorial')} + + + {l10n.getString('onboarding-calibration_tutorial-subtitle')} + +
+ }} + > + + Description on calibration of IMU + + +
+
+
+
-
- -
-
- {progressText} -
-
- - - +
+ +
+
+ {progressText} +
+
+ +
+
-
-
- -
+
+
+
+
- +
); } diff --git a/gui/src/components/onboarding/pages/body-proportions/ManualProportions.tsx b/gui/src/components/onboarding/pages/body-proportions/ManualProportions.tsx index 129947bae..e3567c7c8 100644 --- a/gui/src/components/onboarding/pages/body-proportions/ManualProportions.tsx +++ b/gui/src/components/onboarding/pages/body-proportions/ManualProportions.tsx @@ -33,9 +33,9 @@ import { Typography } from '@/components/commons/Typography'; import { useLocaleConfig } from '@/i18n/config'; import { useNavigate } from 'react-router-dom'; import { ResetButton } from '@/components/home/ResetButton'; +import { Vector3 } from 'three'; import { ProportionsResetModal } from './ProportionsResetModal'; import { BodyProportions } from './BodyProportions'; -import { Vector3 } from 'three'; function IconButton({ onClick, @@ -443,62 +443,60 @@ export function ManualProportionsPage() { ); return ( - <> -
-
- -
- -
-
-
- { - context.addView({ - left: 0, - bottom: 0, - width: 1, - height: 1, - position: new Vector3(3, 2.5, -3), - onHeightChange(v, newHeight) { - // retouch the target and scale settings so the height element doesnt hide the head - v.controls.target.set(0, newHeight / 1.7, 0); - const scale = Math.max(1, newHeight) / 1.2; - v.camera.zoom = 1 / scale; - }, - }); - }} +
+
+ +
+ - -
-
- -
- - - - } - > -
- - {cmFormat.format((userHeight * 100) / 0.936)} - -
-
-
- +
+ { + context.addView({ + left: 0, + bottom: 0, + width: 1, + height: 1, + position: new Vector3(3, 2.5, -3), + onHeightChange(v, newHeight) { + // retouch the target and scale settings so the height element doesnt hide the head + v.controls.target.set(0, newHeight / 1.7, 0); + const scale = Math.max(1, newHeight) / 1.2; + v.camera.zoom = 1 / scale; + }, + }); + }} + /> + +
+
+ +
+ + + + } + > +
+ + {cmFormat.format((userHeight * 100) / 0.936)} + +
+
+
+
+
); } diff --git a/gui/src/components/onboarding/pages/stay-aligned/stay-aligned-steps/RelaxedPoseSteps.tsx b/gui/src/components/onboarding/pages/stay-aligned/stay-aligned-steps/RelaxedPoseSteps.tsx index 7885ae093..daeaed9b8 100644 --- a/gui/src/components/onboarding/pages/stay-aligned/stay-aligned-steps/RelaxedPoseSteps.tsx +++ b/gui/src/components/onboarding/pages/stay-aligned/stay-aligned-steps/RelaxedPoseSteps.tsx @@ -70,60 +70,66 @@ function PosePage({ ); } -export const StandingRelaxedPoseStep = ( +export function StandingRelaxedPoseStep( verticalStepProps: VerticalStepComponentProps -) => ( - - Reset position - -); +) { + return ( + + Reset position + + ); +} -export const SittingRelaxedPoseStep = ( +export function SittingRelaxedPoseStep( verticalStepProps: VerticalStepComponentProps -) => ( - - Reset position - -); +) { + return ( + + Reset position + + ); +} -export const FlatRelaxedPoseStep = ( +export function FlatRelaxedPoseStep( verticalStepProps: VerticalStepComponentProps -) => ( - - Reset position - -); +) { + return ( + + Reset position + + ); +} diff --git a/gui/src/components/settings/pages/InterfaceSettings.tsx b/gui/src/components/settings/pages/InterfaceSettings.tsx index 490ff899f..a1eae856b 100644 --- a/gui/src/components/settings/pages/InterfaceSettings.tsx +++ b/gui/src/components/settings/pages/InterfaceSettings.tsx @@ -326,7 +326,7 @@ export function InterfaceSettings() { - +
diff --git a/gui/src/components/settings/pages/VMCSettings.tsx b/gui/src/components/settings/pages/VMCSettings.tsx index eabb1ded1..dae195e96 100644 --- a/gui/src/components/settings/pages/VMCSettings.tsx +++ b/gui/src/components/settings/pages/VMCSettings.tsx @@ -351,7 +351,7 @@ function getVRMName(json: string): string | null { const data = JSON.parse(json); if (typeof data?.extensions?.VRMC_vrm?.specVersion === 'string') { - const name = data.extensions.VRMC_vrm.meta.name; + const { name } = data.extensions.VRMC_vrm.meta; if (typeof name !== 'string') { error( @@ -361,9 +361,8 @@ function getVRMName(json: string): string | null { } return name; - } else { - return data?.extensions?.VRM?.meta?.title || ''; } + return data?.extensions?.VRM?.meta?.title || ''; } catch (e) { error(e); return null; diff --git a/gui/src/components/settings/pages/components/StayAlignedPoseModal.tsx b/gui/src/components/settings/pages/components/StayAlignedPoseModal.tsx index 08910e6ef..ed980edac 100644 --- a/gui/src/components/settings/pages/components/StayAlignedPoseModal.tsx +++ b/gui/src/components/settings/pages/components/StayAlignedPoseModal.tsx @@ -75,68 +75,74 @@ function StaAlignedPoseModal({ ); } -export const StandingRelaxedPoseModal = ({ +export function StandingRelaxedPoseModal({ open, }: { open: [boolean, Dispatch>]; -}) => ( - - Reset position - -); +}) { + return ( + + Reset position + + ); +} -export const SittingRelaxedPoseModal = ({ +export function SittingRelaxedPoseModal({ open, }: { open: [boolean, Dispatch>]; -}) => ( - - Reset position - -); +}) { + return ( + + Reset position + + ); +} -export const FlatRelaxedPoseModal = ({ +export function FlatRelaxedPoseModal({ open, }: { open: [boolean, Dispatch>]; -}) => ( - - Reset position - -); +}) { + return ( + + Reset position + + ); +} diff --git a/gui/src/components/tracker/TrackerCard.tsx b/gui/src/components/tracker/TrackerCard.tsx index 25fd5bf1a..8363e9870 100644 --- a/gui/src/components/tracker/TrackerCard.tsx +++ b/gui/src/components/tracker/TrackerCard.tsx @@ -14,10 +14,10 @@ import { Link } from 'react-router-dom'; import { useAppContext } from '@/hooks/app'; import { Tooltip } from '@/components/commons/Tooltip'; import { Localized } from '@fluent/react'; +import { checkForUpdate } from '@/hooks/firmware-update'; import { TrackerStatus } from './TrackerStatus'; import { TrackerWifi } from './TrackerWifi'; import { TrackerBattery } from './TrackerBattery'; -import { checkForUpdate } from '@/hooks/firmware-update'; function UpdateIcon({ showUpdate, diff --git a/gui/src/components/tracker/TrackerSettings.tsx b/gui/src/components/tracker/TrackerSettings.tsx index b2330e0f5..5ea590484 100644 --- a/gui/src/components/tracker/TrackerSettings.tsx +++ b/gui/src/components/tracker/TrackerSettings.tsx @@ -37,9 +37,9 @@ import { MagnetometerToggleSetting } from '@/components/settings/pages/Magnetome import semver from 'semver'; import { useSetAtom } from 'jotai'; import { ignoredTrackersAtom } from '@/store/app-store'; +import { checkForUpdate } from '@/hooks/firmware-update'; import { TrackerCard } from './TrackerCard'; import { SingleTrackerBodyAssignmentMenu } from './SingleTrackerBodyAssignmentMenu'; -import { checkForUpdate } from '@/hooks/firmware-update'; const rotationsLabels: [Quaternion, string][] = [ [rotationToQuatMap.BACK, 'tracker-rotation-back'], diff --git a/gui/src/hooks/firmware-update.ts b/gui/src/hooks/firmware-update.ts index 55c0225b8..bd8dcae6c 100644 --- a/gui/src/hooks/firmware-update.ts +++ b/gui/src/hooks/firmware-update.ts @@ -1,7 +1,7 @@ import { BoardType, DeviceDataT } from 'solarxr-protocol'; -import { cacheWrap } from './cache'; import semver from 'semver'; import { hostname, locale, platform, version } from '@tauri-apps/plugin-os'; +import { cacheWrap } from './cache'; type DeployDataJson = Map; type DeployData = Map; diff --git a/gui/src/vite-env.d.ts b/gui/src/vite-env.d.ts index 0fa73892b..12c43d77b 100644 --- a/gui/src/vite-env.d.ts +++ b/gui/src/vite-env.d.ts @@ -7,6 +7,7 @@ declare const __COMMIT_HASH__: string; declare const __VERSION_TAG__: string; // eslint-disable-next-line @typescript-eslint/naming-convention declare const __GIT_CLEAN__: boolean; +// eslint-disable-next-line @typescript-eslint/naming-convention declare const __ANDROID__: | { isThere: () => boolean;