Skip to content

Commit 82e16e2

Browse files
authored
fix: apply prettier to svelte files (#290) (#291)
Signed-off-by: lstocchi <[email protected]>
1 parent 8e06f4c commit 82e16e2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+423
-433
lines changed

Diff for: .prettierrc

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
{
2+
"svelteSortOrder" : "options-styles-scripts-markup",
3+
"svelteStrictMode": true,
4+
"svelteAllowShorthand": false,
5+
"svelteIndentScriptAndStyle": false,
26
"bracketSameLine": true,
37
"singleQuote": true,
48
"arrowParens": "avoid",
59
"printWidth": 120,
6-
"trailingComma": "all"
10+
"trailingComma": "all",
11+
"plugins": ["prettier-plugin-svelte"]
712
}
8-

Diff for: package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"scripts": {
1313
"build": "concurrently \"yarn --cwd packages/frontend build\" \"yarn --cwd packages/backend build\"",
1414
"watch": "concurrently \"yarn --cwd packages/frontend watch\" \"yarn --cwd packages/backend watch\"",
15-
"format:check": "prettier --check \"**/src/**/*.ts\"",
16-
"format:fix": "prettier --write \"**/src/**/*.ts\"",
15+
"format:check": "prettier --check \"**/src/**/*.{ts,svelte}\"",
16+
"format:fix": "prettier --write \"**/src/**/*.{ts,svelte}\"",
1717
"lint:check": "eslint . --ext js,ts,tsx",
1818
"lint:fix": "eslint . --fix --ext js,ts,tsx",
1919
"test:backend": "vitest run -r packages/backend --passWithNoTests --coverage",
@@ -39,7 +39,8 @@
3939
"eslint-plugin-no-null": "^1.0.2",
4040
"eslint-plugin-redundant-undefined": "^1.0.0",
4141
"eslint-plugin-sonarjs": "^0.23.0",
42-
"prettier": "^3.1.1",
42+
"prettier": "^3.2.5",
43+
"prettier-plugin-svelte": "^3.1.2",
4344
"typescript": "5.3.3",
4445
"vite": "^5.0.10",
4546
"vitest": "^1.1.0"

Diff for: packages/frontend/package.json

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
"build": "vite build",
99
"test": "vitest run --coverage",
1010
"test:watch": "vitest watch --coverage",
11-
"format:check": "prettier --check \"src/**/*.ts\"",
12-
"format:fix": "prettier --write \"src/**/*.ts\"",
1311
"watch": "vite --mode development build -w"
1412
},
1513
"dependencies": {

Diff for: packages/frontend/src/App.svelte

+9-10
Original file line numberDiff line numberDiff line change
@@ -27,48 +27,47 @@ onMount(() => {
2727
});
2828
</script>
2929

30-
3130
<Route path="/*" breadcrumb="Home" isAppMounted="{isMounted}" let:meta>
3231
<main class="flex flex-col w-screen h-screen overflow-hidden bg-charcoal-700">
3332
<div class="flex flex-row w-full h-full overflow-hidden">
34-
<Navigation meta="{meta}"/>
33+
<Navigation meta="{meta}" />
3534

3635
<!-- Dashboard -->
3736
<Route path="/" breadcrumb="IA Studio Dashboard Page">
38-
<Dashboard/>
37+
<Dashboard />
3938
</Route>
4039

4140
<!-- Recipes Catalog -->
4241
<Route path="/recipes" breadcrumb="Recipes Catalog">
43-
<Recipes/>
42+
<Recipes />
4443
</Route>
4544

4645
<!-- Environments -->
4746
<Route path="/environments" breadcrumb="Environments">
48-
<Environments/>
47+
<Environments />
4948
</Route>
5049

5150
<!-- Models -->
5251
<Route path="/models" breadcrumb="Models">
53-
<Models/>
52+
<Models />
5453
</Route>
5554

5655
<!-- Registries -->
5756
<Route path="/registries" breadcrumb="Registries">
58-
<Registries/>
57+
<Registries />
5958
</Route>
6059

6160
<!-- Preferences -->
6261
<Route path="/preferences" breadcrumb="Preferences">
63-
<Preferences/>
62+
<Preferences />
6463
</Route>
6564

6665
<Route path="/recipes/:id/*" breadcrumb="Recipe Details" let:meta>
67-
<Recipe recipeId="{meta.params.id}"/>
66+
<Recipe recipeId="{meta.params.id}" />
6867
</Route>
6968

7069
<Route path="/models/:id/*" breadcrumb="Model Details" let:meta>
71-
<Model modelId="{meta.params.id}"/>
70+
<Model modelId="{meta.params.id}" />
7271
</Route>
7372
</div>
7473
</main>

Diff for: packages/frontend/src/Route.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ const route = createRouteObject({
2727
meta = newMeta;
2828
params = meta.params;
2929
30-
if(isAppMounted) {
31-
saveRouterState({url: newMeta.url});
30+
if (isAppMounted) {
31+
saveRouterState({ url: newMeta.url });
3232
}
3333
},
3434
});

Diff for: packages/frontend/src/lib/Card.svelte

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
<script lang="ts">
22
import Fa from 'svelte-fa';
33
import type { IconDefinition } from '@fortawesome/free-regular-svg-icons';
4-
import { createEventDispatcher } from 'svelte'
5-
const dispatch = createEventDispatcher()
4+
import { createEventDispatcher } from 'svelte';
5+
const dispatch = createEventDispatcher();
66
77
export let title: string | undefined = undefined;
8-
export let classes: string = "";
8+
export let classes: string = '';
99
1010
export let href: string | undefined = undefined;
1111
12-
export let icon: IconDefinition | undefined = undefined
12+
export let icon: IconDefinition | undefined = undefined;
1313
14-
export let primaryBackground: string = "bg-charcoal-800"
14+
export let primaryBackground: string = 'bg-charcoal-800';
1515
</script>
1616

1717
<a class="no-underline" href="{href}">
1818
<div class="{classes} rounded-md flex-nowrap overflow-hidden" role="region">
1919
<div class="flex flex-row">
2020
<div class="flex flex-row items-center">
2121
{#if icon}
22-
<button on:click={() => dispatch('click')} class="{primaryBackground} rounded-full w-8 h-8 flex items-center justify-center mr-3">
22+
<button
23+
on:click="{() => dispatch('click')}"
24+
class="{primaryBackground} rounded-full w-8 h-8 flex items-center justify-center mr-3">
2325
<Fa size="20" class="text-purple-500 cursor-pointer" icon="{icon}" />
2426
</button>
2527
{/if}
@@ -37,4 +39,3 @@ export let primaryBackground: string = "bg-charcoal-800"
3739
</div>
3840
</div>
3941
</a>
40-

Diff for: packages/frontend/src/lib/ErrorMessage.svelte

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<script lang="ts">
2-
import Fa from 'svelte-fa';
3-
import { faExclamationCircle } from '@fortawesome/free-solid-svg-icons';
4-
import Tooltip from './Tooltip.svelte';
2+
import Fa from 'svelte-fa';
3+
import { faExclamationCircle } from '@fortawesome/free-solid-svg-icons';
4+
import Tooltip from './Tooltip.svelte';
55
6-
export let error: string;
7-
export let icon = false;
6+
export let error: string;
7+
export let icon = false;
88
</script>
99

1010
{#if icon}

Diff for: packages/frontend/src/lib/ExpandableMessage.svelte

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
2-
export let message: string | undefined = undefined;
3-
export let title: string = 'Expand';
4-
let showMessage: boolean = false;
2+
export let message: string | undefined = undefined;
3+
export let title: string = 'Expand';
4+
let showMessage: boolean = false;
55
</script>
66

77
{#if message}

Diff for: packages/frontend/src/lib/NavPage.svelte

+37-37
Original file line numberDiff line numberDiff line change
@@ -14,54 +14,54 @@ export let contentBackground = '';
1414
<div class="flex flex-col w-full h-full shadow-pageheader">
1515
<div class="flex flex-col w-full h-full pt-4" role="region" aria-label="{title}">
1616
<div class="flex pb-2 px-5" role="region" aria-label="header">
17-
<div class="flex flex-col">
18-
<div class="flex flex-row">
19-
{#if icon}
20-
<div class="bg-charcoal-800 rounded-full w-8 h-8 flex items-center justify-center mr-3">
21-
<Fa size="20" class="text-purple-500" icon="{icon}" />
22-
</div>
23-
{/if}
24-
<h1 class="text-xl first-letter:uppercase">{title}</h1>
25-
</div>
26-
<slot name="subtitle" />
17+
<div class="flex flex-col">
18+
<div class="flex flex-row">
19+
{#if icon}
20+
<div class="bg-charcoal-800 rounded-full w-8 h-8 flex items-center justify-center mr-3">
21+
<Fa size="20" class="text-purple-500" icon="{icon}" />
22+
</div>
23+
{/if}
24+
<h1 class="text-xl first-letter:uppercase">{title}</h1>
2725
</div>
26+
<slot name="subtitle" />
27+
</div>
2828

29-
<div class="flex flex-1 justify-end">
30-
{#if searchEnabled}
31-
<div class="flex flex-row" role="region" aria-label="search">
32-
<div class="pl-5 lg:w-[35rem] w-[22rem] flex justify-end items-center">
33-
<div class="w-full flex items-center bg-charcoal-800 text-gray-700 rounded-sm">
34-
<svg
35-
xmlns="http://www.w3.org/2000/svg"
36-
class="w-5 h-5 ml-2 mr-2"
37-
fill="none"
38-
viewBox="0 0 24 24"
39-
stroke="currentColor">
40-
<path
41-
stroke-linecap="round"
42-
stroke-linejoin="round"
43-
stroke-width="2"
44-
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
45-
</svg>
46-
<input
47-
bind:value="{searchTerm}"
48-
type="text"
49-
name="containerSearchName"
50-
placeholder="Search {title}...."
51-
class="w-full py-2 outline-none text-sm bg-charcoal-800 rounded-sm text-gray-700 placeholder-gray-700" />
52-
</div>
29+
<div class="flex flex-1 justify-end">
30+
{#if searchEnabled}
31+
<div class="flex flex-row" role="region" aria-label="search">
32+
<div class="pl-5 lg:w-[35rem] w-[22rem] flex justify-end items-center">
33+
<div class="w-full flex items-center bg-charcoal-800 text-gray-700 rounded-sm">
34+
<svg
35+
xmlns="http://www.w3.org/2000/svg"
36+
class="w-5 h-5 ml-2 mr-2"
37+
fill="none"
38+
viewBox="0 0 24 24"
39+
stroke="currentColor">
40+
<path
41+
stroke-linecap="round"
42+
stroke-linejoin="round"
43+
stroke-width="2"
44+
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"></path>
45+
</svg>
46+
<input
47+
bind:value="{searchTerm}"
48+
type="text"
49+
name="containerSearchName"
50+
placeholder="Search {title}...."
51+
class="w-full py-2 outline-none text-sm bg-charcoal-800 rounded-sm text-gray-700 placeholder-gray-700" />
5352
</div>
5453
</div>
55-
{/if}
56-
</div>
54+
</div>
55+
{/if}
5756
</div>
57+
</div>
5858

5959
<div class="flex flex-row px-2 border-b border-charcoal-400">
6060
<slot name="tabs" />
6161
</div>
6262
<div class="flex w-full h-full {contentBackground} overflow-auto" role="region" aria-label="content">
6363
{#if loading}
64-
<LinearProgress/>
64+
<LinearProgress />
6565
{:else}
6666
<slot name="content" />
6767
{/if}

Diff for: packages/frontend/src/lib/Navigation.svelte

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export let meta: TinroRouteMeta;
1717
</div>
1818
</div>
1919
<div class="h-full overflow-hidden hover:overflow-y-auto" style="margin-bottom:auto">
20-
2120
<SettingsNavItem title="Recipe Catalog" href="/recipes" bind:meta="{meta}" />
2221

2322
<SettingsNavItem title="Environments" href="/environments" bind:meta="{meta}" />

0 commit comments

Comments
 (0)