Skip to content
This repository was archived by the owner on Apr 13, 2025. It is now read-only.

Remove monaco null assertions to fix linter warnings #314

Merged
merged 1 commit into from
Nov 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion nodecg-io-core/dashboard/serviceInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ const instancePreset = document.getElementById("instancePreset");
const instanceNameField = document.getElementById("instanceNameField");
const instanceEditButtons = document.getElementById("instanceEditButtons");
const instanceCreateButton = document.getElementById("instanceCreateButton");
const instanceMonaco = document.getElementById("instanceMonaco")!;
const instanceMonaco = document.getElementById("instanceMonaco");
if (instanceMonaco === null) {
throw new Error("Couldn't find instanceMonaco");
}
const editor = monaco.editor.create(instanceMonaco, {
theme: "vs-dark",
});
Expand Down
7 changes: 6 additions & 1 deletion services/nodecg-io-debug/dashboard/debug-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,14 @@ setHandler("#list_list_send", "onclick", () => {
});

// JSON
const instanceMonaco = document.getElementById("instanceMonaco");
if (instanceMonaco === null) {
throw new Error("Could not find instanceMonaco");
}

const jsonCode = JSON.stringify({ data: 42 }, null, 4);
const model = monaco.editor.createModel(jsonCode, "json");
const debugMonacoEditor = monaco.editor.create(document.getElementById("instanceMonaco")!, {
const debugMonacoEditor = monaco.editor.create(instanceMonaco, {
model: model,
theme: "vs-dark",
});
Expand Down