Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
laisspportugal committed Jul 24, 2024
1 parent 8148c15 commit 715d48c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packages/studio-base/src/panels/Plot/subscription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// License, v2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/

import type { MessagePathPart, MessagePath } from "@foxglove/message-path";
import type { MessagePath, MessagePathPart } from "@foxglove/message-path";
import type { Immutable } from "@foxglove/studio";
import type {
SubscribePayload,
Expand All @@ -18,7 +18,7 @@ export function pathToSubscribePayload(
const { messagePath: parts, topicName: topic } = path;

const firstField = parts.find(typeIsName);
if (firstField == undefined || firstField.type !== "name" || firstField.name.length === 0) {
if (firstField == undefined || firstField.name.length === 0) {
return undefined;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/studio-base/src/players/UserScriptPlayer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export default class UserScriptPlayer implements Player {
if (!messagesByTopic[outTopic]) {
messagesByTopic[outTopic] = [];
}
messagesByTopic[outTopic]?.push(outputMessage);
messagesByTopic[outTopic].push(outputMessage);
}
}
}
Expand Down
6 changes: 1 addition & 5 deletions packages/studio-base/src/util/VirtualLRUBuffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,7 @@ export default class VirtualLRUBuffer {
);
}
}
const block = this.#blocks[index];
if (!block) {
throw new Error("invariant violation - no block at index");
}
return block;
return this.#blocks[index];
}

// For a given position, calculate `blockIndex` (which block is this position in);
Expand Down
4 changes: 2 additions & 2 deletions packages/studio-base/src/util/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ function getLayoutWithNewPanelIds(
for (const key in layout) {
if (typeof layout[key] === "object" && !Array.isArray(layout[key])) {
newLayout[key] = getLayoutWithNewPanelIds(layout[key] as IndexableMosaic, panelIdMap);
} else if (typeof layout[key] === "string" && panelIdMap[layout[key] as string] != undefined) {
newLayout[key] = panelIdMap[layout[key] as string];
} else if (typeof layout[key] === "string" && panelIdMap[layout[key]] != undefined) {
newLayout[key] = panelIdMap[layout[key]];
} else {
newLayout[key] = layout[key];
}
Expand Down

0 comments on commit 715d48c

Please sign in to comment.