Skip to content

Commit

Permalink
fix: biome kills bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
sverben committed May 3, 2024
1 parent 7c308e6 commit 5f6c182
Show file tree
Hide file tree
Showing 33 changed files with 118 additions and 117 deletions.
3 changes: 3 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"suspicious": {
"noAssignInExpressions": "off",
"noExplicitAny": "off"
},
"style": {
"useConst": "off"
}
}
}
Expand Down
34 changes: 17 additions & 17 deletions src/lib/components/core/header/Header.svelte
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
<script lang="ts">
import { _, locale } from "svelte-i18n";
import block from "$assets/block.svg";
import leaphyLogo from "$assets/leaphy-logo.svg";
import Button from "$components/ui/Button.svelte";
import ContextItem from "$components/ui/ContextItem.svelte";
import Select from "$components/ui/Select.svelte";
import { robots } from "$domain/robots";
import { Screen, Theme, screen, selected, theme } from "$state/app.svelte";
import { audio, workspace } from "$state/blockly.svelte";
import { popups } from "$state/popup.svelte";
import Uploader from "../popups/popups/Uploader.svelte";
import {
Mode,
Prompt,
handle,
port,
code,
handle,
microPythonIO,
microPythonRun,
mode,
Mode,
port,
robot,
saveState,
microPythonIO,
microPythonRun,
} from "$state/workspace.svelte";
import ContextItem from "$components/ui/ContextItem.svelte";
import {
faDownload,
faEnvelope,
Expand All @@ -37,20 +41,16 @@ import {
faVolumeHigh,
faVolumeXmark,
} from "@fortawesome/free-solid-svg-icons";
import block from "$assets/block.svg";
import { Screen, Theme, theme, selected, screen } from "$state/app.svelte";
import SaveProject from "../popups/popups/Prompt.svelte";
import { audio, workspace } from "$state/blockly.svelte";
import { serialization } from "blockly";
import Examples from "../popups/popups/Examples.svelte";
import JSZip from "jszip";
import { type Writable, get } from "svelte/store";
import MicroPythonIO from "../../../micropython";
import About from "../popups/popups/About.svelte";
import Examples from "../popups/popups/Examples.svelte";
import SaveProject from "../popups/popups/Prompt.svelte";
import UploadLog from "../popups/popups/UploadLog.svelte";
import JSZip from "jszip";
import Select from "$components/ui/Select.svelte";
import { robots } from "$domain/robots";
import Uploader from "../popups/popups/Uploader.svelte";
import Warning from "../popups/popups/Warning.svelte";
import MicroPythonIO from "../../../micropython";
import { get, type Writable } from "svelte/store";
async function upload() {
popups.open({
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/core/popups/Popup.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script lang="ts">
import type { PopupState } from "$state/popup.svelte";
import { setContext } from "svelte";
import Windowed from "./Windowed.svelte";
import { writable } from "svelte/store";
import Windowed from "./Windowed.svelte";
interface Props {
state: PopupState;
Expand Down
8 changes: 4 additions & 4 deletions src/lib/components/core/popups/Windowed.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script lang="ts">
import Fa from "svelte-fa";
import type { PopupState } from "$state/popup.svelte";
import WindowButton from "$components/ui/WindowButton.svelte";
import { faClose } from "@fortawesome/free-solid-svg-icons";
import { getContext, onDestroy, onMount, type Snippet } from "svelte";
import type { PopupState } from "$state/popup.svelte";
import { popups } from "$state/popup.svelte";
import { faClose } from "@fortawesome/free-solid-svg-icons";
import { type Snippet, getContext, onDestroy, onMount } from "svelte";
import Fa from "svelte-fa";
import type { Writable } from "svelte/store";
interface Props {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/core/popups/popups/About.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script lang="ts">
import { _ } from "svelte-i18n";
import contribute from "$assets/contribute-foundation.png";
import Button from "$components/ui/Button.svelte";
import { type PopupState, popups } from "$state/popup.svelte";
import { getContext } from "svelte";
import { _ } from "svelte-i18n";
import type { Writable } from "svelte/store";
import { popups, type PopupState } from "$state/popup.svelte";
const popupState = getContext<Writable<PopupState>>("state");
function close() {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/core/popups/popups/Credits.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script lang="ts">
import { _ } from "svelte-i18n";
import leaphyLogo from "$assets/leaphy-logo-color.svg";
import contribute from "$assets/contribute-foundation.png";
import leaphyLogo from "$assets/leaphy-logo-color.svg";
import Button from "$components/ui/Button.svelte";
import { type PopupState, popups } from "$state/popup.svelte";
import { getContext } from "svelte";
import type { Writable } from "svelte/store";
import { popups, type PopupState } from "$state/popup.svelte";
const popupState = getContext<Writable<PopupState>>("state");
function close() {
Expand Down
10 changes: 5 additions & 5 deletions src/lib/components/core/popups/popups/Examples.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<script lang="ts">
import { _ } from "svelte-i18n";
import Windowed from "../Windowed.svelte";
import { inFilter } from "$domain/robots";
import { robot } from "$state/workspace.svelte";
import { getContext, onMount } from "svelte";
import { workspace } from "$state/blockly.svelte";
import { type PopupState, popups } from "$state/popup.svelte";
import { robot } from "$state/workspace.svelte";
import { serialization } from "blockly";
import { getContext, onMount } from "svelte";
import { _ } from "svelte-i18n";
import type { Writable } from "svelte/store";
import { type PopupState, popups } from "$state/popup.svelte";
import Windowed from "../Windowed.svelte";
interface Example {
name: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import leaphyLogo from "$assets/leaphy-logo-color.svg";
import english from "$assets/translations/en.svg";
import dutch from "$assets/translations/nl.svg";
import { popups, type PopupState } from "$state/popup.svelte";
import { type PopupState, popups } from "$state/popup.svelte";
import { getContext } from "svelte";
import { locale } from "svelte-i18n";
import type { Writable } from "svelte/store";
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/core/popups/popups/Prompt.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts">
import { _ } from "svelte-i18n";
import Button from "$components/ui/Button.svelte";
import TextInput from "$components/ui/TextInput.svelte";
import { popups, type PopupState } from "$state/popup.svelte";
import { type PopupState, popups } from "$state/popup.svelte";
import { getContext } from "svelte";
import { _ } from "svelte-i18n";
import type { Writable } from "svelte/store";
interface Props {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/core/popups/popups/SerialMonitor.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts">
import { _ } from "svelte-i18n";
import TextInput from "$components/ui/TextInput.svelte";
import { log } from "$state/workspace.svelte";
import { tick } from "svelte";
import { _ } from "svelte-i18n";
import Windowed from "../Windowed.svelte";
import TextInput from "$components/ui/TextInput.svelte";
let element: HTMLDivElement;
function formatDate(date: Date) {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/core/popups/popups/UploadLog.svelte
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script lang="ts">
import { _ } from "svelte-i18n";
import Windowed from "../Windowed.svelte";
import {
SUPPORTED_VENDOR_IDS,
log,
port,
uploadLog,
} from "$state/workspace.svelte";
import { _ } from "svelte-i18n";
import Windowed from "../Windowed.svelte";
</script>

{#snippet content()}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/core/popups/popups/Uploader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { _ } from "svelte-i18n";
import Button from "$components/ui/Button.svelte";
import ProgressBar from "$components/ui/ProgressBar.svelte";
import { type PopupState, popups } from "$state/popup.svelte";
import { usbRequest } from "$state/upload.svelte";
import {
Prompt,
SUPPORTED_VENDOR_IDS,
Expand All @@ -11,9 +13,7 @@ import {
robot,
} from "$state/workspace.svelte";
import { getContext, onMount } from "svelte";
import { type PopupState, popups } from "$state/popup.svelte";
import type { Writable } from "svelte/store";
import { usbRequest } from "$state/upload.svelte";
interface Props {
source?: string;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/core/popups/popups/Warning.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script lang="ts">
import { _ } from "svelte-i18n";
import Button from "$components/ui/Button.svelte";
import { type PopupState, popups } from "$state/popup.svelte";
import { getContext } from "svelte";
import { popups, type PopupState } from "$state/popup.svelte";
import { _ } from "svelte-i18n";
import type { Writable } from "svelte/store";
interface Props {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/core/sidepanel/SidePanel.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { onDestroy, onMount } from "svelte";
import { sidePanel } from "$state/workspace.svelte";
import { onDestroy, onMount } from "svelte";
let width = $state(300);
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/start/RobotSelector.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { type Robot, robots as allRobots } from "$domain/robots";
import { Screen, selected, screen } from "$state/app.svelte";
import { robot, mode, Mode, code } from "$state/workspace.svelte";
import { Screen, screen, selected } from "$state/app.svelte";
import { Mode, code, mode, robot } from "$state/workspace.svelte";
interface Props {
robots: Robot[][];
Expand Down
8 changes: 4 additions & 4 deletions src/lib/components/start/Start.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script lang="ts">
import { fly } from "svelte/transition";
import { flip } from "svelte/animate";
import { selected } from "$state/app.svelte";
import { robotListing } from "$domain/robots";
import RobotSelector from "$components/start/RobotSelector.svelte";
import { robotListing } from "$domain/robots";
import { selected } from "$state/app.svelte";
import { flip } from "svelte/animate";
import { cubicOut } from "svelte/easing";
import { fly } from "svelte/transition";
const selectors = $derived(
$selected ? [robotListing, $selected.variants] : [robotListing],
Expand Down
6 changes: 3 additions & 3 deletions src/lib/components/ui/Button.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts">
import { onDestroy, onMount, setContext, type Snippet } from "svelte";
import ContextMenu from "./ContextMenu.svelte";
import { writable, type Writable } from "svelte/store";
import type { IconDefinition } from "@fortawesome/free-solid-svg-icons";
import { type Snippet, onDestroy, onMount, setContext } from "svelte";
import Fa from "svelte-fa";
import { type Writable, writable } from "svelte/store";
import ContextMenu from "./ContextMenu.svelte";
interface Props {
name?: string;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/ui/CodeEditor.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script lang="ts">
import { onMount } from "svelte";
import * as monaco from "monaco-editor";
import { Theme, theme } from "$state/app.svelte";
import * as monaco from "monaco-editor";
import { onMount } from "svelte";
interface Props {
value: string;
Expand Down
8 changes: 4 additions & 4 deletions src/lib/components/ui/ContextItem.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts">
import {
faCaretRight,
type IconDefinition,
faCaretRight,
} from "@fortawesome/free-solid-svg-icons";
import { getContext, onDestroy, onMount, type Snippet } from "svelte";
import { type Snippet, getContext, onDestroy, onMount } from "svelte";
import Fa from "svelte-fa";
import type { Writable } from "svelte/store";
import ContextMenu from "./ContextMenu.svelte";
Expand All @@ -15,7 +15,7 @@ interface Props {
context?: Snippet<[Writable<boolean>]>;
disabled?: boolean;
selected?: boolean;
open: Writable<boolean>
open: Writable<boolean>;
}
let {
icon,
Expand All @@ -24,7 +24,7 @@ let {
context,
disabled = false,
selected = false,
open
open,
}: Props = $props();
let element = $state<HTMLDivElement>();
Expand Down
6 changes: 3 additions & 3 deletions src/lib/components/ui/ContextMenu.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<script lang="ts">
import { getContext, onDestroy, onMount, type Snippet } from "svelte";
import { computePosition, type Placement } from "@floating-ui/dom";
import { type Placement, computePosition } from "@floating-ui/dom";
import { type Snippet, getContext, onDestroy, onMount } from "svelte";
import type { Writable } from "svelte/store";
interface Props {
source: HTMLElement;
content: Snippet<[Writable<boolean>]>;
anchor?: Placement;
open: Writable<boolean>
open: Writable<boolean>;
}
let { source, content, anchor = "bottom-start", open }: Props = $props();
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/ui/Library.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { _ } from "svelte-i18n";
import type { Library } from "$state/app.svelte";
import { installed } from "$state/workspace.svelte";
import Select from "./Select.svelte";
import Button from "./Button.svelte";
import Select from "./Select.svelte";
interface Props {
library: Library;
Expand Down
6 changes: 3 additions & 3 deletions src/lib/components/workspace/Workspace.svelte
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<script lang="ts">
import SerialMonitor from "$components/core/popups/popups/SerialMonitor.svelte";
import SidePanel from "$components/core/sidepanel/SidePanel.svelte";
import SideBar from "$components/ui/SideBar.svelte";
import SideButton from "$components/ui/SideButton.svelte";
import { popups } from "$state/popup.svelte";
import { sidePanel, mode, Mode } from "$state/workspace.svelte";
import { Mode, mode, sidePanel } from "$state/workspace.svelte";
import {
faBook,
faCode,
faSquarePollHorizontal,
} from "@fortawesome/free-solid-svg-icons";
import LibraryManager from "./panels/LibraryManager.svelte";
import Code from "./panels/Code.svelte";
import SideBar from "$components/ui/SideBar.svelte";
import LibraryManager from "./panels/LibraryManager.svelte";
function openSerial() {
popups.open({
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/workspace/advanced/Advanced.svelte
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<script lang="ts">
import SerialMonitor from "$components/core/popups/popups/SerialMonitor.svelte";
import CodeEditor from "$components/ui/CodeEditor.svelte";
import SideBar from "$components/ui/SideBar.svelte";
import SideButton from "$components/ui/SideButton.svelte";
import { popups } from "$state/popup.svelte";
import { code, sidePanel } from "$state/workspace.svelte";
import {
faBook,
faCode,
faSquarePollHorizontal,
} from "@fortawesome/free-solid-svg-icons";
import Code from "../panels/Code.svelte";
import { popups } from "$state/popup.svelte";
import SerialMonitor from "$components/core/popups/popups/SerialMonitor.svelte";
import LibraryManager from "../panels/LibraryManager.svelte";
</script>

Expand Down
Loading

0 comments on commit 5f6c182

Please sign in to comment.