From b97d0186df4a5b3dca0a0a479ec606ceb93590b6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Jul 2024 16:21:57 +0000 Subject: [PATCH 1/2] Bump prettier from 3.0.3 to 3.3.2 Bumps [prettier](https://github.com/prettier/prettier) from 3.0.3 to 3.3.2. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.0.3...3.3.2) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package.json | 2 +- yarn.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index cc68a74b60..5784f14a00 100644 --- a/package.json +++ b/package.json @@ -114,7 +114,7 @@ "jest": "29.7.0", "jest-environment-jsdom": "29.7.0", "license-checker": "25.0.1", - "prettier": "3.0.3", + "prettier": "3.3.2", "rimraf": "5.0.5", "semver": "7.5.4", "storybook": "7.6.20", diff --git a/yarn.lock b/yarn.lock index 5540dbe3ec..88fd79b4ae 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13362,7 +13362,7 @@ __metadata: jest: 29.7.0 jest-environment-jsdom: 29.7.0 license-checker: 25.0.1 - prettier: 3.0.3 + prettier: 3.3.2 react-use: 17.5.1 rehype-raw: 6.1.1 rimraf: 5.0.5 @@ -18945,12 +18945,12 @@ __metadata: languageName: node linkType: hard -"prettier@npm:3.0.3": - version: 3.0.3 - resolution: "prettier@npm:3.0.3" +"prettier@npm:3.3.2": + version: 3.3.2 + resolution: "prettier@npm:3.3.2" bin: prettier: bin/prettier.cjs - checksum: e10b9af02b281f6c617362ebd2571b1d7fc9fb8a3bd17e371754428cda992e5e8d8b7a046e8f7d3e2da1dcd21aa001e2e3c797402ebb6111b5cd19609dd228e0 + checksum: 5557d8caed0b182f68123c2e1e370ef105251d1dd75800fadaece3d061daf96b1389141634febf776050f9d732c7ae8fd444ff0b4a61b20535e7610552f32c69 languageName: node linkType: hard From e33941727adfe3cea6448b38dfefe9f4f3adde3b Mon Sep 17 00:00:00 2001 From: Lais Portugal Date: Fri, 5 Jul 2024 11:46:24 +0100 Subject: [PATCH 2/2] prettier --- ci/lint-dependencies.ts | 4 +- .../mcap-support/src/parseFlatbufferSchema.ts | 5 +- .../MockMessagePipelineProvider.tsx | 4 +- .../PlaybackControls/sharedHelpers.ts | 4 +- .../SettingsTreeEditor/NodeEditor.tsx | 4 +- .../SettingsTreeEditor/inputs/NumberInput.tsx | 4 +- .../TimeBasedChartTooltipContent.tsx | 8 +-- .../src/components/TopicList/ContextMenu.tsx | 4 +- .../builders/TimestampDatasetsBuilderImpl.ts | 4 +- .../renderables/primitives/RenderableLines.ts | 4 +- .../primitives/RenderableModels.ts | 4 +- .../primitives/RenderableTriangles.ts | 4 +- .../transforms/TransformTree.ts | 4 +- .../src/panels/diagnostics/util.ts | 4 +- .../players/FoxgloveWebSocketPlayer/index.ts | 4 +- .../providers/ExtensionCatalogProvider.tsx | 4 +- .../services/LayoutManager/LayoutManager.ts | 4 +- .../migrateLegacyToNew3DPanels.ts | 4 +- packages/studio-base/src/util/naturalSort.ts | 7 ++- packages/studio/src/immutable.ts | 60 +++++++++---------- 20 files changed, 72 insertions(+), 72 deletions(-) diff --git a/ci/lint-dependencies.ts b/ci/lint-dependencies.ts index 769b8f4697..c350d3187c 100644 --- a/ci/lint-dependencies.ts +++ b/ci/lint-dependencies.ts @@ -116,8 +116,8 @@ async function getAllWorkspacePackages(roots: string[]) { const patterns: string[] = Array.isArray(workspaceInfo.workspaces) ? workspaceInfo.workspaces : Array.isArray(workspaceInfo.workspaces?.packages) - ? workspaceInfo.workspaces.packages - : []; + ? workspaceInfo.workspaces.packages + : []; for (const pattern of patterns) { for (const packagePath of await promisify(glob)(pattern)) { workspacePackages.push(path.resolve(process.cwd(), workspaceRoot, packagePath)); diff --git a/packages/mcap-support/src/parseFlatbufferSchema.ts b/packages/mcap-support/src/parseFlatbufferSchema.ts index aaae23bd2f..666f99e9f1 100644 --- a/packages/mcap-support/src/parseFlatbufferSchema.ts +++ b/packages/mcap-support/src/parseFlatbufferSchema.ts @@ -79,8 +79,9 @@ function typeForField(schema: SchemaT, field: FieldT): MessageDefinitionField[] const enums = schema.enums[field.type.index]?.values; if (enums == undefined) { throw new Error( - `Invalid schema, missing enum values for field type ${schema.enums[field.type.index] - ?.name}`, + `Invalid schema, missing enum values for field type ${ + schema.enums[field.type.index]?.name + }`, ); } for (const enumVal of enums) { diff --git a/packages/studio-base/src/components/MessagePipeline/MockMessagePipelineProvider.tsx b/packages/studio-base/src/components/MessagePipeline/MockMessagePipelineProvider.tsx index 5e11bdb9fa..f6864d7fb0 100644 --- a/packages/studio-base/src/components/MessagePipeline/MockMessagePipelineProvider.tsx +++ b/packages/studio-base/src/components/MessagePipeline/MockMessagePipelineProvider.tsx @@ -144,8 +144,8 @@ function getPublicState( props.topics === prevState?.mockProps.topics ? prevState?.public.sortedTopics ?? [] : props.topics - ? [...props.topics].sort((a, b) => a.name.localeCompare(b.name)) - : [], + ? [...props.topics].sort((a, b) => a.name.localeCompare(b.name)) + : [], datatypes: props.datatypes ?? NO_DATATYPES, setSubscriptions: (props.setSubscriptions === prevState?.mockProps.setSubscriptions diff --git a/packages/studio-base/src/components/PlaybackControls/sharedHelpers.ts b/packages/studio-base/src/components/PlaybackControls/sharedHelpers.ts index 37f9d7945f..95a645d029 100644 --- a/packages/studio-base/src/components/PlaybackControls/sharedHelpers.ts +++ b/packages/studio-base/src/components/PlaybackControls/sharedHelpers.ts @@ -31,7 +31,7 @@ export const jumpSeek = ( modifierKeys?.altKey === true ? ARROW_SEEK_BIG_MS : modifierKeys?.shiftKey === true - ? ARROW_SEEK_SMALL_MS - : ARROW_SEEK_DEFAULT_MS; + ? ARROW_SEEK_SMALL_MS + : ARROW_SEEK_DEFAULT_MS; return fromMillis(timeMs + deltaMs * directionSign); }; diff --git a/packages/studio-base/src/components/SettingsTreeEditor/NodeEditor.tsx b/packages/studio-base/src/components/SettingsTreeEditor/NodeEditor.tsx index 19476a8d20..28f45a4a7e 100644 --- a/packages/studio-base/src/components/SettingsTreeEditor/NodeEditor.tsx +++ b/packages/studio-base/src/components/SettingsTreeEditor/NodeEditor.tsx @@ -268,8 +268,8 @@ function NodeEditorComponent(props: NodeEditorProps): JSX.Element { state.visibilityFilter === "visible" ? showVisibleFilter : state.visibilityFilter === "invisible" - ? showInvisibleFilter - : undefined; + ? showInvisibleFilter + : undefined; const childNodes = filterMap(prepareSettingsNodes(children ?? {}), ([key, child]) => { return !filterFn || filterFn(child) ? ( @@ -166,8 +166,8 @@ export default function TimeBasedChartTooltipContent( typeof tooltip.value === "string" ? tooltip.value : typeof tooltip.value === "bigint" - ? tooltip.value.toString() - : JSON.stringify(tooltip.value); + ? tooltip.value.toString() + : JSON.stringify(tooltip.value); return ( diff --git a/packages/studio-base/src/components/TopicList/ContextMenu.tsx b/packages/studio-base/src/components/TopicList/ContextMenu.tsx index 7df86ad624..86ec551892 100644 --- a/packages/studio-base/src/components/TopicList/ContextMenu.tsx +++ b/packages/studio-base/src/components/TopicList/ContextMenu.tsx @@ -27,8 +27,8 @@ export function ContextMenu(props: { ? t("copyMessagePath") : t("copyMessagePaths") : messagePaths.length === 1 - ? t("copyTopicName") - : t("copyTopicNames"), + ? t("copyTopicName") + : t("copyTopicNames"), onClick: () => { onClose(); copyToClipboard(messagePaths.map((item) => item.path).join("\n")); diff --git a/packages/studio-base/src/panels/Plot/builders/TimestampDatasetsBuilderImpl.ts b/packages/studio-base/src/panels/Plot/builders/TimestampDatasetsBuilderImpl.ts index 06aa30fde0..3f0202ca29 100644 --- a/packages/studio-base/src/panels/Plot/builders/TimestampDatasetsBuilderImpl.ts +++ b/packages/studio-base/src/panels/Plot/builders/TimestampDatasetsBuilderImpl.ts @@ -194,8 +194,8 @@ export class TimestampDatasetsBuilderImpl { items.length < min ? items.map((item) => item.index) : dataset.showLine === true - ? downsampleTimeseries(items, downsampleViewport, maxPoints) - : downsampleScatter(items, downsampleViewport); + ? downsampleTimeseries(items, downsampleViewport, maxPoints) + : downsampleScatter(items, downsampleViewport); // When a series is downsampled the points are disabled as a visual indicator that // data is downsampled. diff --git a/packages/studio-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableLines.ts b/packages/studio-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableLines.ts index f62590d216..d4c6c87d84 100644 --- a/packages/studio-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableLines.ts +++ b/packages/studio-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableLines.ts @@ -219,8 +219,8 @@ class LinePrimitiveRenderable extends THREE.Object3D { const singleColor = this.#color ? stringToRgba(tempRgba, this.#color) : this.#primitive.colors.length === 0 - ? this.#primitive.color - : undefined; + ? this.#primitive.color + : undefined; if (singleColor == undefined) { assert(this.#geometry, "Line Group geometry must exist"); diff --git a/packages/studio-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableModels.ts b/packages/studio-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableModels.ts index a96e694448..2a0b49c9f8 100644 --- a/packages/studio-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableModels.ts +++ b/packages/studio-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableModels.ts @@ -321,8 +321,8 @@ export class RenderableModels extends RenderablePrimitive { const overrideColor = this.userData.settings.color ? stringToRgba(tempRgba, this.userData.settings.color) : primitive.override_color - ? primitive.color - : undefined; + ? primitive.color + : undefined; if (overrideColor) { if (!renderable.material) { renderable.material = new THREE.MeshStandardMaterial({ diff --git a/packages/studio-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableTriangles.ts b/packages/studio-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableTriangles.ts index d31f9acdea..624c76582e 100644 --- a/packages/studio-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableTriangles.ts +++ b/packages/studio-base/src/panels/ThreeDeeRender/renderables/primitives/RenderableTriangles.ts @@ -65,8 +65,8 @@ export class RenderableTriangles extends RenderablePrimitive { const singleColor = this.userData.settings.color ? stringToRgba(tempRgba, this.userData.settings.color) : primitive.colors.length === 0 - ? primitive.color - : undefined; + ? primitive.color + : undefined; if (!singleColor && !geometry.attributes.color) { geometry.createAttribute("color", Uint8Array, 4, true); diff --git a/packages/studio-base/src/panels/ThreeDeeRender/transforms/TransformTree.ts b/packages/studio-base/src/panels/ThreeDeeRender/transforms/TransformTree.ts index 85b649fa9f..b1fa1cb715 100644 --- a/packages/studio-base/src/panels/ThreeDeeRender/transforms/TransformTree.ts +++ b/packages/studio-base/src/panels/ThreeDeeRender/transforms/TransformTree.ts @@ -100,8 +100,8 @@ export class TransformTree { return cycleDetected ? AddTransformResult.CYCLE_DETECTED : updated - ? AddTransformResult.UPDATED - : AddTransformResult.NOT_UPDATED; + ? AddTransformResult.UPDATED + : AddTransformResult.NOT_UPDATED; } /** diff --git a/packages/studio-base/src/panels/diagnostics/util.ts b/packages/studio-base/src/panels/diagnostics/util.ts index f9c0a79792..29d7329b9f 100644 --- a/packages/studio-base/src/panels/diagnostics/util.ts +++ b/packages/studio-base/src/panels/diagnostics/util.ts @@ -105,8 +105,8 @@ export function getDisplayName(hardwareId: string, name: string): string { ? `${hardwareId}: ${name}` : `${name}` : hardwareId.length > 0 - ? `${hardwareId}` - : `(empty)`; + ? `${hardwareId}` + : `(empty)`; } // ensures the diagnostic status message's name consists of both the hardware id and the name diff --git a/packages/studio-base/src/players/FoxgloveWebSocketPlayer/index.ts b/packages/studio-base/src/players/FoxgloveWebSocketPlayer/index.ts index cfb9e23269..1088a1c02b 100644 --- a/packages/studio-base/src/players/FoxgloveWebSocketPlayer/index.ts +++ b/packages/studio-base/src/players/FoxgloveWebSocketPlayer/index.ts @@ -316,8 +316,8 @@ export default class FoxgloveWebSocketPlayer implements Player { const rosDataTypes = isRos1 ? CommonRosTypes.ros1 : ["foxy", "galactic"].includes(rosDistro) - ? CommonRosTypes.ros2galactic - : CommonRosTypes.ros2humble; + ? CommonRosTypes.ros2galactic + : CommonRosTypes.ros2humble; const dataTypes: MessageDefinitionMap = new Map(); for (const dataType in rosDataTypes) { diff --git a/packages/studio-base/src/providers/ExtensionCatalogProvider.tsx b/packages/studio-base/src/providers/ExtensionCatalogProvider.tsx index f346ae3012..5598be57af 100644 --- a/packages/studio-base/src/providers/ExtensionCatalogProvider.tsx +++ b/packages/studio-base/src/providers/ExtensionCatalogProvider.tsx @@ -57,8 +57,8 @@ function activateExtension( process.env.NODE_ENV === "production" ? "production" : process.env.NODE_ENV === "test" - ? "test" - : "development"; + ? "test" + : "development"; const ctx: ExtensionContext = { mode: extensionMode, diff --git a/packages/studio-base/src/services/LayoutManager/LayoutManager.ts b/packages/studio-base/src/services/LayoutManager/LayoutManager.ts index 1fa44ff257..a7255c30ed 100644 --- a/packages/studio-base/src/services/LayoutManager/LayoutManager.ts +++ b/packages/studio-base/src/services/LayoutManager/LayoutManager.ts @@ -292,8 +292,8 @@ export default class LayoutManager implements ILayoutManager { data == undefined ? localLayout.working : isLayoutEqual(localLayout.baseline.data, data) - ? undefined - : { data, savedAt: now }; + ? undefined + : { data, savedAt: now }; // Renames of shared layouts go directly to the server if (name != undefined && layoutIsShared(localLayout)) { diff --git a/packages/studio-base/src/services/migrateLayout/migrateLegacyToNew3DPanels.ts b/packages/studio-base/src/services/migrateLayout/migrateLegacyToNew3DPanels.ts index 4b17105f8f..be9c5dc86c 100644 --- a/packages/studio-base/src/services/migrateLayout/migrateLegacyToNew3DPanels.ts +++ b/packages/studio-base/src/services/migrateLayout/migrateLegacyToNew3DPanels.ts @@ -57,8 +57,8 @@ function migrateLegacyToNew3DConfig(legacyConfig: Partial): Rend legacyConfig.followMode === "follow-orientation" ? "follow-pose" : legacyConfig.followMode === "follow" - ? "follow-position" - : "follow-none", + ? "follow-position" + : "follow-none", cameraState: { ...DEFAULT_CAMERA_STATE, ...legacyConfig.cameraState, diff --git a/packages/studio-base/src/util/naturalSort.ts b/packages/studio-base/src/util/naturalSort.ts index d477cc2795..ff92ca916b 100644 --- a/packages/studio-base/src/util/naturalSort.ts +++ b/packages/studio-base/src/util/naturalSort.ts @@ -15,9 +15,10 @@ import natsort from "natsort"; const sortFn = natsort({ insensitive: true }); -type StringOrNumberFields = T extends Record - ? { [K in keyof T]: T[K] extends string | number ? K : never }[keyof T] - : never; +type StringOrNumberFields = + T extends Record + ? { [K in keyof T]: T[K] extends string | number ? K : never }[keyof T] + : never; function naturalSort(): typeof sortFn; function naturalSort>(key: K): (a: T, b: T) => number; diff --git a/packages/studio/src/immutable.ts b/packages/studio/src/immutable.ts index 203cd7d82b..14bd011a4f 100644 --- a/packages/studio/src/immutable.ts +++ b/packages/studio/src/immutable.ts @@ -44,38 +44,36 @@ export type IsTuple = Type extends readonly any[] : Type : never; -export type IsUnknown = IsAny extends true - ? false - : unknown extends Type - ? true - : false; +export type IsUnknown = + IsAny extends true ? false : unknown extends Type ? true : false; // https://stackoverflow.com/questions/49927523/disallow-call-with-any/49928360#49928360 export type IsAny = 0 extends 1 & Type ? true : false; -export type Immutable = Type extends Exclude - ? Type - : Type extends Map - ? ReadonlyMap, Immutable> - : Type extends ReadonlyMap - ? ReadonlyMap, Immutable> - : Type extends WeakMap - ? WeakMap, Immutable> - : Type extends Set - ? ReadonlySet> - : Type extends ReadonlySet - ? ReadonlySet> - : Type extends WeakSet - ? WeakSet> - : Type extends Promise - ? Promise> - : Type extends AnyArray - ? Type extends IsTuple - ? { readonly [Key in keyof Type]: Immutable } - : ReadonlyArray> - : // eslint-disable-next-line @typescript-eslint/ban-types - Type extends {} - ? { readonly [Key in keyof Type]: Immutable } - : IsUnknown extends true - ? unknown - : Readonly; +export type Immutable = + Type extends Exclude + ? Type + : Type extends Map + ? ReadonlyMap, Immutable> + : Type extends ReadonlyMap + ? ReadonlyMap, Immutable> + : Type extends WeakMap + ? WeakMap, Immutable> + : Type extends Set + ? ReadonlySet> + : Type extends ReadonlySet + ? ReadonlySet> + : Type extends WeakSet + ? WeakSet> + : Type extends Promise + ? Promise> + : Type extends AnyArray + ? Type extends IsTuple + ? { readonly [Key in keyof Type]: Immutable } + : ReadonlyArray> + : // eslint-disable-next-line @typescript-eslint/ban-types + Type extends {} + ? { readonly [Key in keyof Type]: Immutable } + : IsUnknown extends true + ? unknown + : Readonly;