Skip to content

Commit

Permalink
style: lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xmlking committed Jun 18, 2024
1 parent 51fca32 commit 65b7c3a
Show file tree
Hide file tree
Showing 18 changed files with 68 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const actions = {
log.debug('before cleanClone with null:', form.data);
const dataCopy = cleanClone(form.data, { empty: 'null' });
log.debug('after cleanClone with null:', dataCopy);
const payload: devices_set_input = dataCopy;
const payload: devices_set_input = dataCopy;
const variables = { id, data: payload };
log.debug('UPDATE action variables:', variables);
const { errors, data } = await updateDeviceStore.mutate(variables, {
Expand Down
2 changes: 1 addition & 1 deletion apps/console/src/lib/components/layout/header.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import LangSwitch from '$lib/components/layout/lang-switch.svelte';
// import LoadingIndicatorSpinner from '$lib/components/layout/loading-indicator-spinner.svelte';
import LoadingIndicatorBar from '$lib/components/layout/loading-indicator-bar.svelte';
import { storeTheme } from '$lib/stores';
import { isAuthenticated, user } from '$lib/stores/user';
import type { DrawerSettings, ModalSettings } from '@skeletonlabs/skeleton';
import { AppBar, LightSwitch, getDrawerStore, getModalStore, popup } from '@skeletonlabs/skeleton';
import { LogoIcon } from '@spectacular/skeleton/components/logos';
Expand All @@ -21,7 +22,6 @@ import {
Scroll,
Search,
} from 'lucide-svelte';
import { isAuthenticated, user } from '$lib/stores/user';
import Avatar from './avatar.svelte';
const drawerStore = getDrawerStore();
Expand Down
6 changes: 3 additions & 3 deletions apps/console/src/lib/graphql/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { createClient as createWSClient } from 'graphql-ws';

const url = env.PUBLIC_GRAPHQL_ENDPOINT;

const log = new Logger(browser? 'houdini.browser.client': 'houdini.server.client');
const log = new Logger(browser ? 'houdini.browser.client' : 'houdini.server.client');

// in order to verify that we send metadata, we need something that will log the metadata after
const logMetadata: ClientPlugin = () => ({
Expand Down Expand Up @@ -40,10 +40,10 @@ export default new HoudiniClient({
url,
fetchParams({ session, metadata }) {
if (metadata) {
log.debug('metadata...', {metadata});
log.debug('metadata...', { metadata });
}
if (session) {
log.debug('session...', {session});
log.debug('session...', { session });
}
const accessToken = session?.accessToken;
const backendToken = metadata?.backendToken;
Expand Down
6 changes: 3 additions & 3 deletions apps/console/src/routes/(app)/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!-- Layout: (dashboard) -->
<script lang="ts">
import { page } from '$app/stores';
import { goto } from '$app/navigation';
import { nhost, isAuthenticated } from '$lib/stores/user';
import { onMount } from 'svelte';
import { page } from '$app/stores';
import WaitForAuth from '$lib/components/layout/wait-for-auth.svelte';
import { isAuthenticated, nhost } from '$lib/stores/user';
import { onMount } from 'svelte';
export let data;
Expand Down
4 changes: 2 additions & 2 deletions apps/console/src/routes/(auth)/signin/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ const {
pwDelayed.subscribe((v) => ($isLoadingForm = v));
pwlDelayed.subscribe((v) => ($isLoadingForm = v));
$pwForm.redirectTo = $page.url.searchParams.get('redirectTo') ?? $pwForm.redirectTo
$pwlForm.redirectTo = $page.url.searchParams.get('redirectTo') ?? $pwlForm.redirectTo
$pwForm.redirectTo = $page.url.searchParams.get('redirectTo') ?? $pwForm.redirectTo;
$pwlForm.redirectTo = $page.url.searchParams.get('redirectTo') ?? $pwlForm.redirectTo;
</script>

<svelte:head>
Expand Down
2 changes: 1 addition & 1 deletion apps/console/src/routes/(auth)/signout/+page.server.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { NHOST_SESSION_KEY } from '$lib/constants';
import { i18n } from '$lib/i18n';
import { Logger } from '@spectacular/utils';
import { redirect as redirectWithFlash } from 'sveltekit-flash-message/server';
import type { Actions } from './$types';
import { NHOST_SESSION_KEY } from '$lib/constants';

const log = new Logger('server:auth:signout');

Expand Down
3 changes: 1 addition & 2 deletions apps/console/src/routes/(auth)/signup/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@ const { form, delayed, timeout, enhance, errors, constraints, message, tainted,
export const snapshot = { capture, restore };
// Reactivity
// Used in apps/console/src/lib/components/layout/page-load-spinner.svelte
delayed.subscribe((v) => ($isLoadingForm = v));
$form.redirectTo = $page.url.searchParams.get('redirectTo') ?? $form.redirectTo
$form.redirectTo = $page.url.searchParams.get('redirectTo') ?? $form.redirectTo;
// $: termsValue = $form.terms as Writable<boolean>;
</script>

Expand Down
2 changes: 1 addition & 1 deletion apps/console/src/routes/(home)/about/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { user, isAuthenticated } from '$lib/stores/user';
import { isAuthenticated, user } from '$lib/stores/user';
import { Debug } from '@spectacular/skeleton/components';
</script>

Expand Down
2 changes: 1 addition & 1 deletion apps/console/src/routes/(home)/contact/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { user, accessToken } from '$lib/stores/user';
import { accessToken, user } from '$lib/stores/user';
import { Debug } from '@spectacular/skeleton/components';
</script>

Expand Down
18 changes: 14 additions & 4 deletions apps/console/src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import Header from '$lib/components/layout/header.svelte';
import Sidebar from '$lib/components/layout/sidebar.svelte';
import { i18n } from '$lib/i18n';
import Search from '$lib/modals/search.svelte';
import { nhost } from '$lib/stores/user';
import { scroll, storeTheme, storeVercelProductionMode } from '$lib/stores';
import { nhost } from '$lib/stores/user';
import { arrow, autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom';
import { ParaglideJS } from '@inlang/paraglide-js-adapter-sveltekit';
import { Modal, initializeStores, prefersReducedMotionStore, storePopup } from '@skeletonlabs/skeleton';
Expand Down Expand Up @@ -45,7 +45,17 @@ const modalComponentRegistry: Record<string, ModalComponent> = {
modalSearch: { ref: Search },
};
const noSidebarPaths = ['/signin', '/signup', '/password-reset', '/privacy', '/terms', '/docs', '/blog', '/about','/contact'];
const noSidebarPaths = [
'/signin',
'/signup',
'/password-reset',
'/privacy',
'/terms',
'/docs',
'/blog',
'/about',
'/contact',
];
function matchNoSidebarPaths(pathname: string): boolean {
const canonicalPath = i18n.route(pathname);
if (canonicalPath === '/' || startsWith(canonicalPath, noSidebarPaths)) {
Expand Down Expand Up @@ -81,8 +91,8 @@ $: allyPageSmoothScroll = !$prefersReducedMotionStore ? 'scroll-smooth' : '';
// update nhost session
// HINT: https://blog.flotes.app/posts/performant-reactivity
$: ({ session } = data)
$: if(browser) {
$: ({ session } = data);
$: if (browser) {
if (session) {
log.debug('trigger SESSION_UPDATE', { session });
nhost.auth.client.interpreter?.send('SESSION_UPDATE', { data: { session } });
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/components/app-footer.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import { Icon } from "@astrojs/starlight/components";
import Container from "./container.astro";
import { Icon } from '@astrojs/starlight/components';
import Container from './container.astro';
---

<footer class="py-20 md:py-40">
Expand Down
16 changes: 8 additions & 8 deletions apps/web/src/components/app-header.astro
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
import Container from "./container.astro";
import Container from './container.astro';
// import LightSwitcher from './light-switcher.astro';
import LightSwitcher from "./light-switcher.svelte";
import LightSwitcher from './light-switcher.svelte';
const links = [
{
to: "/#features",
label: "Features",
to: '/#features',
label: 'Features',
},
{
to: "/#solution",
label: "Solution",
to: '/#solution',
label: 'Solution',
},
{
to: "/#reviews",
label: "Reviews",
to: '/#reviews',
label: 'Reviews',
},
];
---
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/light-switcher.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Moon, Sun } from 'lucide-svelte';
import { mode, toggleMode } from 'mode-watcher';
import { twMerge } from 'tailwind-merge';
export let labelClass =
export const labelClass =
'flex h-8 w-8 cursor-pointer items-center justify-center rounded-full bg-slate-100 hover:bg-slate-200 dark:bg-slate-700 dark:hover:bg-slate-600/80';
</script>

Expand Down
15 changes: 6 additions & 9 deletions apps/web/src/layouts/layout.astro
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
---
// import '@fontsource-variable/inter';
// import '@fontsource/source-code-pro';
import "@styles/tailwind.css";
import AppFooter from "@components/app-footer.astro";
import AppHeader from "@components/app-header.astro";
import { SEO } from "astro-seo";
import { ModeWatcher } from "mode-watcher";
import '@styles/tailwind.css';
import AppFooter from '@components/app-footer.astro';
import AppHeader from '@components/app-header.astro';
import { SEO } from 'astro-seo';
import { ModeWatcher } from 'mode-watcher';
interface Props {
title: string;
}
const canonicalURL = new URL(Astro.url.pathname, Astro.site).toString();
const resolvedImageWithDomain = new URL(
"/opengraph.jpg",
Astro.site,
).toString();
const resolvedImageWithDomain = new URL('/opengraph.jpg', Astro.site).toString();
const { title } = Astro.props;
---

Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/pages/404.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import { Icon } from "@astrojs/starlight/components";
import Container from "@components/container.astro";
import Layout from "@layouts/layout.astro";
import { Icon } from '@astrojs/starlight/components';
import Container from '@components/container.astro';
import Layout from '@layouts/layout.astro';
---

<Layout title="404 Not Found">
Expand Down
18 changes: 9 additions & 9 deletions apps/web/src/pages/about.astro
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
import { Image } from "astro:assets";
import { getCollection } from "astro:content";
import Container from "@components/container.astro";
import SectionHead from "@components/section-head.astro";
import Layout from "@layouts/layout.astro";
import { Image } from 'astro:assets';
import { getCollection } from 'astro:content';
import Container from '@components/container.astro';
import SectionHead from '@components/section-head.astro';
import Layout from '@layouts/layout.astro';
// Filter team entries with 'draft: false' & date before current date
const publishedTeamMembers = await getCollection("team", ({ data }) => {
const publishedTeamMembers = await getCollection('team', ({ data }) => {
return !data.draft && data.publishedAt < new Date();
});
import { PUBLIC_SOME_CLIENT_FEATURE_FLAG } from "astro:env/client";
import { PUBLIC_SOME_SERVER_FEATURE_FLAG, getSecret } from "astro:env/server";
import { PUBLIC_SOME_CLIENT_FEATURE_FLAG } from 'astro:env/client';
import { PUBLIC_SOME_SERVER_FEATURE_FLAG, getSecret } from 'astro:env/server';
if (PUBLIC_SOME_SERVER_FEATURE_FLAG) {
const API_PORT = getSecret("API_PORT"); // number
const API_PORT = getSecret('API_PORT'); // number
console.log({ API_PORT });
}
console.log({ PUBLIC_SOME_CLIENT_FEATURE_FLAG });
Expand Down
8 changes: 4 additions & 4 deletions apps/web/src/pages/blog/[slug].astro
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
import { getCollection } from "astro:content";
import Container from "@components/container.astro";
import Layout from "@layouts/layout.astro";
import { getCollection } from 'astro:content';
import Container from '@components/container.astro';
import Layout from '@layouts/layout.astro';
// Generate a new path for every collection entry
export async function getStaticPaths() {
const blogEntries = await getCollection("posts");
const blogEntries = await getCollection('posts');
return blogEntries.map((entry) => ({
params: { slug: entry.slug },
props: { entry },
Expand Down
16 changes: 7 additions & 9 deletions apps/web/src/pages/blog/index.astro
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
---
import { Image } from "astro:assets";
import { getCollection } from "astro:content";
import Container from "@components/container.astro";
import SectionHead from "@components/section-head.astro";
import Layout from "@layouts/layout.astro";
import { Image } from 'astro:assets';
import { getCollection } from 'astro:content';
import Container from '@components/container.astro';
import SectionHead from '@components/section-head.astro';
import Layout from '@layouts/layout.astro';
// Filter blog entries with 'draft: false' & date before current date
const publishedBlogEntries = await getCollection("posts", ({ data }) => {
const publishedBlogEntries = await getCollection('posts', ({ data }) => {
return !data.draft && data.publishedAt < new Date();
});
// Sort content entries by publication date
publishedBlogEntries.sort(
(a, b) => b.data.publishedAt.valueOf() - a.data.publishedAt.valueOf(),
);
publishedBlogEntries.sort((a, b) => b.data.publishedAt.valueOf() - a.data.publishedAt.valueOf());
---

<Layout title="Blog">
Expand Down

0 comments on commit 65b7c3a

Please sign in to comment.