Skip to content

Commit eb03fd5

Browse files
committed
style: apply prettier and eslint fixes
1 parent 8fcdbec commit eb03fd5

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

js/widgets/__tests__/jseditor.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ global.document = {
3737
createElement: jest.fn().mockImplementation(createMockElement),
3838
head: { appendChild: jest.fn() },
3939
body: { appendChild: jest.fn() },
40-
querySelector: jest.fn(),
40+
querySelector: jest.fn()
4141
};
4242

4343
global.window = {
@@ -55,7 +55,7 @@ const mockWidgetWindow = {
5555
onmaximize: null,
5656
clear: jest.fn(),
5757
show: jest.fn(),
58-
setPosition: jest.fn(),
58+
setPosition: jest.fn()
5959
};
6060

6161
global.window.widgetWindows = {
@@ -66,13 +66,13 @@ global.docById.mockReturnValue({ height: 500, style: {}, innerText: "", innerHTM
6666
const JSEditor = require("../jseditor.js"); // Assuming jseditor.js exports the class or sets global. No, it sets window.jsEditor usually?
6767
// Actually jseditor.js content shows "class JSEditor ..." but doesn't show "module.exports".
6868
// It ends with: "window.jsEditor = this;" inside constructor? No, inside _setup.
69-
// And it seems to rely on being loaded as a script.
69+
// And it seems to rely on being loaded as a script.
7070
// If it's not a module, simple requiring it might not return the class if it doesn't assign to module.exports.
7171
// However, the file content shows "class JSEditor". If it is not exported, we can't import it in Node test.
72-
// We might need to eval it or rely on it setting a global if we require it.
72+
// We might need to eval it or rely on it setting a global if we require it.
7373
// Let's assume standard behavior for this codebase. PitchSlider uses `require("../pitchslider.js")`.
7474
// This implies `pitchslider.js` has `module.exports`.
75-
// I'll assume `jseditor.js` also has `module.exports = JSEditor;` at the end (not shown in my view_file output).
75+
// I'll assume `jseditor.js` also has `module.exports = JSEditor;` at the end (not shown in my view_file output).
7676
// Let's verify that.
7777

7878
describe("JSEditor Highlight Compatibility", () => {

js/widgets/jseditor.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,12 @@ class JSEditor {
327327
tooltip.style.whiteSpace = "nowrap";
328328
tooltip.textContent = tooltipText;
329329

330-
tooltip.style.top = `${rect.bottom + window.scrollY + (positionOfTooltip !== "bottom" ? -30 : 20)
331-
}px`;
332-
tooltip.style.left = `${rect.left + window.scrollX + (positionOfTooltip !== "bottom" ? -135 : 0)
333-
}px`;
330+
tooltip.style.top = `${
331+
rect.bottom + window.scrollY + (positionOfTooltip !== "bottom" ? -30 : 20)
332+
}px`;
333+
tooltip.style.left = `${
334+
rect.left + window.scrollX + (positionOfTooltip !== "bottom" ? -135 : 0)
335+
}px`;
334336
});
335337

336338
targetButton.addEventListener("mouseout", () => {
@@ -818,7 +820,8 @@ class JSEditor {
818820
const currentLine = lines[insertIndex].trim();
819821
if (!currentLine.endsWith("{") && !currentLine.endsWith(";")) {
820822
JSEditor.logConsole(
821-
`Cannot add breakpoint to line ${lineNumber + 1
823+
`Cannot add breakpoint to line ${
824+
lineNumber + 1
822825
}. Breakpoints can only be added after lines ending with '{' or ';'`,
823826
"red"
824827
);
@@ -831,7 +834,8 @@ class JSEditor {
831834
(lines[insertIndex + 1] && lines[insertIndex + 1].trim() === "debugger;")
832835
) {
833836
JSEditor.logConsole(
834-
`Cannot add breakpoint to line ${lineNumber + 1
837+
`Cannot add breakpoint to line ${
838+
lineNumber + 1
835839
} because there is already a breakpoint on an adjacent line.`,
836840
"red"
837841
);

0 commit comments

Comments
 (0)