Skip to content

Commit

Permalink
chore: svelte lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
iansamz committed Jul 13, 2023
1 parent 1fde3c2 commit 07fded0
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 31 deletions.
11 changes: 6 additions & 5 deletions svelte-kit-scss/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:svelte/recommended",
"prettier",
"plugin:storybook/recommended"
],
"plugins": ["svelte3", "@typescript-eslint", "prettier"],
"plugins": ["@typescript-eslint", "prettier"],
"ignorePatterns": ["*.cjs"],
"overrides": [
{
"files": ["*.svelte"],
"processor": "svelte3/svelte3"
"parser": "svelte-eslint-parser",
"parserOptions": {
"parser": "@typescript-eslint/parser"
}
}
],
"settings": {
"svelte3/typescript": true
},
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2020
Expand Down
24 changes: 12 additions & 12 deletions svelte-kit-scss/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
class:current={isCurrent(option)}
on:click={async () => await handleItemClick(option)}
on:keypress={async () => await handleItemClick(option)}
role="button"
tabindex="0"
>
<div class="checkbox">
<Check16 />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
</div>
<div class="content">
<span class="markdown">
<!-- eslint-disable-next-line svelte/no-at-html-tags -->
{@html html}
</span>
</div>
Expand Down
3 changes: 2 additions & 1 deletion svelte-kit-scss/src/lib/components/NavBar/NavBar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@
<MarkGithub16 height="32" width="32" fill="white" />
</a>
</li>
<li on:click={closeDropdown} on:keypress={closeDropdown} class="dropdown">
<li class="dropdown">
<button
type="button"
class="dropdown-title"
aria-controls="nav-dropdown"
on:click|stopPropagation={toggleMenu}
on:blur={closeDropdown}
data-testid="nav-dropdown"
>
<img src={userAvatar} alt="{username} avatar" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@
</script>

<div class="dropdown-container noselect" use:clickOutside on:clickoutside={close}>
<div on:click|stopPropagation={toggle} on:keypress|stopPropagation={toggle}>
<div
role="button"
tabindex="0"
on:click|stopPropagation={toggle}
on:keypress|stopPropagation={toggle}
>
<slot />
</div>
{#if isOpen}
Expand All @@ -30,7 +35,7 @@
>
<div class="header">
<div class="description">{descriptionDisplay}</div>
<div class="close" on:click={close} on:keypress={close}>
<div class="close" on:click={close} on:keypress={close} role="button" tabindex="0">
<X16 class="close-icon" />
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import DropdownItemTemplateCheckbox from '../item-templates/DropdownItemTemplateCheckbox.svelte';
export let description: string | undefined;
type TOption = $$Generic;
type TOption = $$Generic; /* eslint-disable-line no-undef */
export let options: TOption[];
export let labelAccessor = (option: TOption) => String(option);
export let checkedPredicate: (option: TOption) => boolean = () => false;
Expand All @@ -26,6 +26,8 @@
class="dropdown-menu-item-layout"
on:click={() => handleOptionClick(option)}
on:keypress={() => handleOptionClick(option)}
role="button"
tabindex="0"
>
{#if $$slots.option}
<slot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@
>
<div class="header">
<div class="description">{description}</div>
<div class="close" on:click={closeDropdown} on:keypress={closeDropdown}>
<div
class="close"
on:click={closeDropdown}
on:keypress={closeDropdown}
role="button"
tabindex="0"
>
<span class:invisible={current?.value === defaultFilter}>
<X16 />
</span>
Expand All @@ -62,15 +68,17 @@

<ul class="items">
{#each items as item}
<li
class="item noselect"
on:click={() => handleFilterOptionClick(item)}
on:keypress={() => handleFilterOptionClick(item)}
>
<span class="icon" class:invisible={item !== current}>
<Check16 />
</span>
<span>{item.label}</span>
<li class="item noselect">
<button
type="button"
on:click={() => handleFilterOptionClick(item)}
on:keypress={() => handleFilterOptionClick(item)}
>
<span class="icon" class:invisible={item !== current}>
<Check16 />
</span>
<span>{item.label}</span>
</button>
</li>
{/each}
</ul>
Expand Down

0 comments on commit 07fded0

Please sign in to comment.