chore(prettier): use svelteStrictMode

This commit is contained in:
Eric Liu 2020-09-04 16:35:49 -07:00
commit 42b8159b1c
182 changed files with 2020 additions and 1912 deletions

View file

@ -16,21 +16,21 @@
{#if story === 'selected'}
<ContentSwitcher
{light}
on:change={({ detail }) => {
light="{light}"
on:change="{({ detail }) => {
console.log('on:change', detail);
}}>
}}">
<Switch {...$$props} text="First section" />
<Switch {...$$props} text="Second section" selected />
<Switch {...$$props} text="Third section" />
</ContentSwitcher>
{:else}
<ContentSwitcher
{light}
light="{light}"
bind:selectedIndex
on:change={({ detail }) => {
on:change="{({ detail }) => {
console.log('on:change', detail);
}}>
}}">
<Switch {...$$props} text="First section" />
<Switch {...$$props} text="Second section" />
<Switch {...$$props}>
@ -42,9 +42,9 @@
</ContentSwitcher>
<div
style="margin-top: 1.5rem"
on:click={() => {
on:click="{() => {
selectedIndex = 1;
}}>
}}">
Programmatically set to second index
</div>
{/if}

View file

@ -58,8 +58,8 @@
<div
role="tablist"
class:bx--content-switcher={true}
class:bx--content-switcher--light={light}
class:bx--content-switcher="{true}"
class:bx--content-switcher--light="{light}"
{...$$restProps}
on:click
on:mouseover

View file

@ -52,31 +52,31 @@
</script>
<button
bind:this={ref}
bind:this="{ref}"
role="tab"
tabindex={selected ? '0' : '-1'}
aria-selected={selected}
{disabled}
{id}
class:bx--content-switcher-btn={true}
class:bx--content-switcher--selected={selected}
tabindex="{selected ? '0' : '-1'}"
aria-selected="{selected}"
disabled="{disabled}"
id="{id}"
class:bx--content-switcher-btn="{true}"
class:bx--content-switcher--selected="{selected}"
{...$$restProps}
on:click
on:click|preventDefault={() => {
on:click|preventDefault="{() => {
ctx.update(id);
}}
}}"
on:mouseover
on:mouseenter
on:mouseleave
on:keydown
on:keydown={({ key }) => {
on:keydown="{({ key }) => {
if (key === 'ArrowRight') {
ctx.change(1);
} else if (key === 'ArrowLeft') {
ctx.change(-1);
}
}}>
<span class:bx--content-switcher__label={true}>
}}">
<span class:bx--content-switcher__label="{true}">
<slot>{text}</slot>
</span>
</button>