Skip to content

Commit

Permalink
Bump prettier from 3.0.3 to 3.3.2 (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored Jul 23, 2024
1 parent e012fcf commit c8eb4d6
Show file tree
Hide file tree
Showing 22 changed files with 78 additions and 78 deletions.
4 changes: 2 additions & 2 deletions ci/lint-dependencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions packages/mcap-support/src/parseFlatbufferSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Original file line number Diff line number Diff line change
Expand Up @@ -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) ? (
<NodeEditor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ export function NumberInput(
inputRef.current === document.activeElement
? value
: value != undefined
? _.round(value, precision)
: undefined;
? _.round(value, precision)
: undefined;

return (
<TextField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,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 (
<Stack className={classes.root} data-testid="TimeBasedChartTooltipContent">
Expand All @@ -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 (
<Fragment key={idx}>
Expand Down
4 changes: 2 additions & 2 deletions packages/studio-base/src/components/TopicList/ContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ export class TransformTree {
return cycleDetected
? AddTransformResult.CYCLE_DETECTED
: updated
? AddTransformResult.UPDATED
: AddTransformResult.NOT_UPDATED;
? AddTransformResult.UPDATED
: AddTransformResult.NOT_UPDATED;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/studio-base/src/panels/diagnostics/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ function migrateLegacyToNew3DConfig(legacyConfig: Partial<Legacy3DConfig>): Rend
legacyConfig.followMode === "follow-orientation"
? "follow-pose"
: legacyConfig.followMode === "follow"
? "follow-position"
: "follow-none",
? "follow-position"
: "follow-none",
cameraState: {
...DEFAULT_CAMERA_STATE,
...legacyConfig.cameraState,
Expand Down
7 changes: 4 additions & 3 deletions packages/studio-base/src/util/naturalSort.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ import natsort from "natsort";

const sortFn = natsort({ insensitive: true });

type StringOrNumberFields<T> = T extends Record<string, unknown>
? { [K in keyof T]: T[K] extends string | number ? K : never }[keyof T]
: never;
type StringOrNumberFields<T> =
T extends Record<string, unknown>
? { [K in keyof T]: T[K] extends string | number ? K : never }[keyof T]
: never;

function naturalSort(): typeof sortFn;
function naturalSort<T, K extends StringOrNumberFields<T>>(key: K): (a: T, b: T) => number;
Expand Down
60 changes: 29 additions & 31 deletions packages/studio/src/immutable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,38 +44,36 @@ export type IsTuple<Type> = Type extends readonly any[]
: Type
: never;

export type IsUnknown<Type> = IsAny<Type> extends true
? false
: unknown extends Type
? true
: false;
export type IsUnknown<Type> =
IsAny<Type> extends true ? false : unknown extends Type ? true : false;

// https://stackoverflow.com/questions/49927523/disallow-call-with-any/49928360#49928360
export type IsAny<Type> = 0 extends 1 & Type ? true : false;

export type Immutable<Type> = Type extends Exclude<Builtin, Error>
? Type
: Type extends Map<infer Keys, infer Values>
? ReadonlyMap<Immutable<Keys>, Immutable<Values>>
: Type extends ReadonlyMap<infer Keys, infer Values>
? ReadonlyMap<Immutable<Keys>, Immutable<Values>>
: Type extends WeakMap<infer Keys, infer Values>
? WeakMap<Immutable<Keys>, Immutable<Values>>
: Type extends Set<infer Values>
? ReadonlySet<Immutable<Values>>
: Type extends ReadonlySet<infer Values>
? ReadonlySet<Immutable<Values>>
: Type extends WeakSet<infer Values>
? WeakSet<Immutable<Values>>
: Type extends Promise<infer Value>
? Promise<Immutable<Value>>
: Type extends AnyArray<infer Values>
? Type extends IsTuple<Type>
? { readonly [Key in keyof Type]: Immutable<Type[Key]> }
: ReadonlyArray<Immutable<Values>>
: // eslint-disable-next-line @typescript-eslint/ban-types
Type extends {}
? { readonly [Key in keyof Type]: Immutable<Type[Key]> }
: IsUnknown<Type> extends true
? unknown
: Readonly<Type>;
export type Immutable<Type> =
Type extends Exclude<Builtin, Error>
? Type
: Type extends Map<infer Keys, infer Values>
? ReadonlyMap<Immutable<Keys>, Immutable<Values>>
: Type extends ReadonlyMap<infer Keys, infer Values>
? ReadonlyMap<Immutable<Keys>, Immutable<Values>>
: Type extends WeakMap<infer Keys, infer Values>
? WeakMap<Immutable<Keys>, Immutable<Values>>
: Type extends Set<infer Values>
? ReadonlySet<Immutable<Values>>
: Type extends ReadonlySet<infer Values>
? ReadonlySet<Immutable<Values>>
: Type extends WeakSet<infer Values>
? WeakSet<Immutable<Values>>
: Type extends Promise<infer Value>
? Promise<Immutable<Value>>
: Type extends AnyArray<infer Values>
? Type extends IsTuple<Type>
? { readonly [Key in keyof Type]: Immutable<Type[Key]> }
: ReadonlyArray<Immutable<Values>>
: // eslint-disable-next-line @typescript-eslint/ban-types
Type extends {}
? { readonly [Key in keyof Type]: Immutable<Type[Key]> }
: IsUnknown<Type> extends true
? unknown
: Readonly<Type>;
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit c8eb4d6

Please sign in to comment.