Clean up web code errors and make CI enforce them

This commit is contained in:
Keavon Chambers
2024-09-24 01:33:02 -07:00
parent 14de67c5a7
commit 1ee5ffbbe8
18 changed files with 44 additions and 129 deletions
@@ -203,7 +203,7 @@
function setColorRGB(channel: keyof RGB, strength: number | undefined) {
// Do nothing if the given value is undefined
if (strength === undefined) undefined;
if (strength === undefined) return undefined;
// Set the specified channel to the given value
else if (channel === "r") setColor(new Color(strength / 255, newColor.green, newColor.blue, newColor.alpha));
else if (channel === "g") setColor(new Color(newColor.red, strength / 255, newColor.blue, newColor.alpha));
@@ -212,7 +212,7 @@
function setColorHSV(channel: keyof HSV, strength: number | undefined) {
// Do nothing if the given value is undefined
if (strength === undefined) undefined;
if (strength === undefined) return undefined;
// Set the specified channel to the given value
else if (channel === "h") hue = strength / 360;
else if (channel === "s") saturation = strength / 100;
@@ -219,7 +219,7 @@
childReference.open = true;
// The reason we bother taking `highlightdEntry` as an argument is because, when this function is called, it can ensure `highlightedEntry` is not undefined.
// But here we still have to set `highlighted` to itself so Svelte knows to reactively update it after we set its `.ref.open` property.
// But here we still have to set `highlighted` to itself so Svelte knows to reactively update it after we set its `childReference.open` property.
highlighted = highlighted;
// Highlight first item
@@ -452,11 +452,11 @@
{#if entry.children}
<MenuList
on:naturalWidth={() => {
on:naturalWidth={({ detail }) => {
// We do a manual dispatch here instead of just `on:naturalWidth` as a workaround for the <script> tag
// at the top of this file displaying a "'render' implicitly has return type 'any' because..." error.
// See explanation at <https://github.com/sveltejs/language-tools/issues/452#issuecomment-723148184>.
dispatch("naturalWidth");
dispatch("naturalWidth", detail);
}}
open={getChildReference(entry)?.open || false}
direction="TopRight"