Skip to content

Commit 1e38214

Browse files
authored
Merge pull request #9 from kevinkace/feat/cleanup-base
fix linting
2 parents c68e615 + 5e1ea25 commit 1e38214

11 files changed

Lines changed: 37 additions & 29 deletions

File tree

eslint.config.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,18 @@ export default ts.config(
1717
languageOptions: {
1818
globals: { ...globals.browser, ...globals.node }
1919
},
20-
rules: { // typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
21-
// see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
22-
"no-undef": 'off' }
20+
rules: {
21+
// typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
22+
// https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
23+
"no-undef": 'off',
24+
25+
// disable no-at-html-tags from eslint-plugin-svelte to allow @html directive in Svelte files
26+
"svelte/no-at-html-tags": 'off',
27+
28+
// https://github.com/sveltejs/eslint-plugin-svelte/issues/1353
29+
'svelte/no-navigation-without-resolve': 'off',
30+
31+
}
2332
},
2433
{
2534
files: [

src/lib/components/Carousel.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<div class="embla" use:emblaCarouselSvelte="{{ options, plugins }}">
1212
<div class="embla__container">
13-
{#each imgs as img}
13+
{#each imgs as img (img) }
1414
<div class="embla__slide">
1515
<img src={img} alt="Carousel" />
1616
</div>

src/lib/components/Footer.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<p>{m['common.mission.desc']()}</p>
3333
</div>
3434
<div class="ctas">
35-
{#each buttons as { href, cta}}
35+
{#each buttons as { href, cta} (href)}
3636
<div>
3737
<Button {href} type="medium">{cta}</Button>
3838
</div>

src/lib/components/Header.svelte

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
</script>
4848

4949
<header data-test="site-header">
50-
<a href={'/'} class="logo-link" data-test="site-logo-link">
51-
<img class="logo" src={"/layout/header/logo.min.png"} alt="">
50+
<a href='/' class="logo-link" data-test="site-logo-link">
51+
<img class="logo" src="/layout/header/logo.min.png" alt="">
5252

5353
{#if currentUrl === '/'}
5454
<h1 class="logotype">{m['common.scn']()}</h1>
@@ -62,18 +62,18 @@
6262

6363
showNav = !showNav;
6464
}}>
65-
<img src={"/layout/nav-hamburger.svg"} alt={m['common.toggle_nav']()}>
65+
<img src="/layout/nav-hamburger.svg" alt={m['common.toggle_nav']()}>
6666
</button>
6767
</header>
6868

6969
<nav class="nav" data-test="site-nav">
7070
<div class="nav-items" class:show-nav={showNav}>
71-
{#each navItems as {href, label}}
71+
{#each navItems as {href, label} (href)}
7272
<a
7373
href={href}
7474
class="nav-link"
7575
class:active={href === currentUrl}
76-
onclick={(e) => {
76+
onclick={() => {
7777
showNav = false; // close nav on click
7878
}}
7979
>

src/lib/components/Partners.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
{m['pages.home.partners.paragraphs.0']()}
1111
</p>
1212

13-
<img src={"/pages/home/scn-partner-logos.min.png"} loading="lazy" alt={m['pages.home.partners.alt']()} />
13+
<img src="/pages/home/scn-partner-logos.min.png" loading="lazy" alt={m['pages.home.partners.alt']()} />

src/lib/components/Socials.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
</script>
4141

4242
<div class={cssClass}>
43-
{#each socials as { href, cta, src }}
43+
{#each socials as { href, cta, src } (href)}
4444
<a {href} data-test={`social-${cta.toLowerCase()}`}>
4545
<img src={src[type]} alt={cta} />
4646
</a>

src/routes/+error.svelte

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<script lang="ts">
2-
import { page } from '$app/state';
3-
2+
import { page } from '$app/state';
43
import { m } from '$lib/paraglide/messages.js';
54
import Wrapper from '$lib/components/Wrapper.svelte';
65
import PageTitle from '$lib/components/Page-Title.svelte';
@@ -19,7 +18,7 @@
1918
}
2019
};
2120
22-
let { status = 404 as 404 | 500 } = $props();
21+
const {status = 404 as 404 | 500} = page;
2322
</script>
2423

2524
<PageTitle title={errors[status].title} />
@@ -32,7 +31,7 @@
3231
{errors[status].description}
3332
</p>
3433
<p>
35-
<a href={'/'} class="button">
34+
<a href='/' class="button">
3635
{errors[status].cta}
3736
</a>
3837
</p>

src/routes/+page.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<PageTitle />
4040

4141
<section class="carousel-wrapper" data-test="home-carousel">
42-
<Carousel imgs={imgs} />
42+
<Carousel {imgs} />
4343
</section>
4444

4545

@@ -68,7 +68,7 @@
6868
{m['pages.home.overview.header']()}
6969
</h2>
7070

71-
{#each overview as over}
71+
{#each overview as over (over)}
7272
<p>{@html over}</p>
7373
{/each}
7474

@@ -91,8 +91,8 @@
9191
</h2>
9292

9393
<div class="button-row">
94-
{#each buttons as { href, cta, dataTest } }
95-
<Button href={href} arrow={true} dataTest={dataTest}>
94+
{#each buttons as { href, cta, dataTest } (href)}
95+
<Button {href} arrow={true} dataTest={dataTest}>
9696
{cta}
9797
</Button>
9898
{/each}

src/routes/about-us/+page.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
<PageTitle title={m["pages.about.title"]()} />
5353

5454
<Wrapper dataTest="about-page">
55-
{#each sections as section, index}
55+
{#each sections as section, index (section.key)}
5656
<section data-test={`about-us-${section.key}`}>
5757
<Panel type="plain">
5858
{#if index === 0}
@@ -61,7 +61,7 @@
6161
<h2>{section.header}</h2>
6262
{/if}
6363

64-
{#each section.paragraphs as paragraph}
64+
{#each section.paragraphs as paragraph (paragraph) }
6565
<p>{@html paragraph}</p>
6666
{/each}
6767

@@ -77,7 +77,7 @@
7777
<p>{m["pages.about.values.paragraphs.0"]()}</p>
7878

7979
<ul class="values-list">
80-
{#each valuesList as value}
80+
{#each valuesList as value (value)}
8181
<li>{value}</li>
8282
{/each}
8383
</ul>

src/routes/donate/+page.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@
3434
<input type="hidden" name="currency_code" value="USD" />
3535
<button class="paypal-button">
3636
<!--<img id = "paypal-graphic" src = "assets/paypal button.png" alt = "paypal button">-->
37-
<input type="image" src={"/layout/paypal-button.png"} name="submit" title="Paypal donations are made to lcl@seattlecommunitynetwork.org." alt="Donate with PayPal button" />
37+
<input type="image" src="/layout/paypal-button.png" name="submit" title="Paypal donations are made to lcl@seattlecommunitynetwork.org." alt="Donate with PayPal button" />
3838
</button>
39-
<img alt="" src={"https://www.paypal.com/en_US/i/scr/pixel.gif"} width="1" height="1" />
39+
<img alt="" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
4040
</form>
4141

42-
{#each buttons as { href, cta }}
42+
{#each buttons as { href, cta } (href)}
4343
<Button {href} type="donate" dataTest={`donate-${cta.toLowerCase()}`}>{cta}</Button>
4444
{/each}
4545
</div>

0 commit comments

Comments
 (0)