Skip to content

Commit

Permalink
Merge pull request #20 from rema424/rema424-patch-1
Browse files Browse the repository at this point in the history
Fix linting errors for TypeScript-enabled setups
  • Loading branch information
kresnasatya authored Jan 26, 2025
2 parents a1ada8c + a175fa0 commit 6455989
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
<script lang="ts">
import type { Snippet } from 'svelte';
import type { ComponentProps, Snippet } from 'svelte';
import { Link } from '@inertiajs/svelte';
import type { Method } from '@inertiajs/core';
let {
children,
href,
method,
as,
...attrs
}: {
children: Snippet;
href: string;
method?: Method;
as?: keyof HTMLElementTagNameMap;
} = $props();
} & ComponentProps<Link> = $props();
</script>

<Link
{...attrs}
{href}
class="block w-full px-4 py-2 text-start text-sm leading-5 text-gray-700 transition duration-150 ease-in-out hover:bg-gray-100 focus:bg-gray-100 focus:outline-none dark:text-gray-300 dark:hover:bg-gray-800 dark:focus:bg-gray-800"
>
{@render children()}
Expand Down
12 changes: 2 additions & 10 deletions stubs/inertia-svelte-ts/resources/js/Components/NavLink.svelte
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
<script lang="ts">
import type { Snippet } from 'svelte';
import type { ComponentProps, Snippet } from 'svelte';
import { Link } from '@inertiajs/svelte';
import type { Method } from '@inertiajs/core';
let {
active = false,
children,
href,
method,
as,
...attrs
}: {
active?: boolean;
children: Snippet;
href: string;
method?: Method;
as?: keyof HTMLElementTagNameMap;
} = $props();
} & ComponentProps<Link> = $props();
</script>

<Link
{...attrs}
{href}
class={active
? 'inline-flex items-center px-1 pt-1 border-b-2 border-indigo-400 dark:border-indigo-600 text-sm font-medium leading-5 text-gray-900 dark:text-gray-100 focus:outline-none focus:border-indigo-700 transition duration-150 ease-in-out'
: 'inline-flex items-center px-1 pt-1 border-b-2 border-transparent text-sm font-medium leading-5 text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 hover:border-gray-300 dark:hover:border-gray-700 focus:outline-none focus:text-gray-700 dark:focus:text-gray-300 focus:border-gray-300 dark:focus:border-gray-700 transition duration-150 ease-in-out'}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
<script lang="ts">
import type { Snippet } from 'svelte';
import type { ComponentProps, Snippet } from 'svelte';
import { Link } from '@inertiajs/svelte';
import type { Method } from '@inertiajs/core';
let {
active = false,
children,
href,
method,
as,
...attrs
}: {
active?: boolean;
children: Snippet;
href: string;
method?: Method;
as?: keyof HTMLElementTagNameMap;
} = $props();
} & ComponentProps<Link> = $props();
</script>

<Link
{...attrs}
{href}
class={`
block w-full border-l-4 py-2 pe-4 ps-3 text-start text-base font-medium transition duration-150 ease-in-out
${
Expand Down

0 comments on commit 6455989

Please sign in to comment.