Skip to content

Commit 687129b

Browse files
committed
fix: adapt code from eslint-plugin-svelte 3.0.x rules
Signed-off-by: Jeff MAURY <[email protected]>
1 parent 7ecd910 commit 687129b

5 files changed

+10
-5
lines changed

eslint.config.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export default [
201201
},
202202

203203
{
204-
files: ['**/*.svelte'],
204+
files: ['**/*.svelte', '**/*.svelte.ts'],
205205

206206
languageOptions: {
207207
parser: svelteParser,

src/lib/ui/ExtensionsByCategory.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const { extensionByCategoryInfo }: { extensionByCategoryInfo: ExtensionByCategor
1515
role="region"
1616
aria-label="Extensions of category {extensionByCategoryInfo.category}"
1717
>
18-
{#each extensionByCategoryInfo.extensions as extension}
18+
{#each extensionByCategoryInfo.extensions as extension (extension.id)}
1919
<ExtensionByCategoryCard {extension} />
2020
{/each}
2121
</div>

src/lib/ui/ExtensionsDetailsBottom.svelte

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ $effect(() => {
4646
<th>Version</th>
4747
<th>Released</th>
4848
</tr>
49-
{#each versions as version}
49+
{#each versions as version (version.version)}
5050
<tr>
5151
<td>{version.version}</td>
5252
<td>{moment(version.lastUpdated).format('YYYY-MM-DD')}</td>

src/lib/ui/ExtensionsList.spec.ts

+5
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ test('if per_page is passed in with 4, it should show last 4 extensions even if
119119
category: 'category1',
120120
extensions: [
121121
{
122+
id: 'dummy1',
122123
displayName: 'dummy1',
123124
versions: [
124125
{
@@ -129,6 +130,7 @@ test('if per_page is passed in with 4, it should show last 4 extensions even if
129130
],
130131
} as unknown as CatalogExtensionInfo,
131132
{
133+
id: 'dummy2',
132134
displayName: 'dummy2',
133135
versions: [
134136
{
@@ -139,6 +141,7 @@ test('if per_page is passed in with 4, it should show last 4 extensions even if
139141
],
140142
} as unknown as CatalogExtensionInfo,
141143
{
144+
id: 'dummy3',
142145
displayName: 'dummy3',
143146
versions: [
144147
{
@@ -149,6 +152,7 @@ test('if per_page is passed in with 4, it should show last 4 extensions even if
149152
],
150153
} as unknown as CatalogExtensionInfo,
151154
{
155+
id: 'dummy4',
152156
displayName: 'dummy4',
153157
versions: [
154158
{
@@ -159,6 +163,7 @@ test('if per_page is passed in with 4, it should show last 4 extensions even if
159163
],
160164
} as unknown as CatalogExtensionInfo,
161165
{
166+
id: 'dummy5',
162167
displayName: 'dummy5',
163168
versions: [
164169
{

src/lib/ui/ExtensionsList.svelte

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ $effect(() => {
4040

4141
<div class="flex flex-col h-full">
4242
{#if showCategories}
43-
{#each extensionsByCategories as extensionByCategoryInfo}
43+
{#each extensionsByCategories as extensionByCategoryInfo (extensionByCategoryInfo.category)}
4444
<ExtensionsByCategory {extensionByCategoryInfo} />
4545
{/each}
4646
{:else}
@@ -49,7 +49,7 @@ $effect(() => {
4949
role="region"
5050
aria-label="Filtered extensions"
5151
>
52-
{#each filteredExtensions as extension}
52+
{#each filteredExtensions as extension (extension.id)}
5353
<ExtensionByCategoryCard {extension} />
5454
{/each}
5555
</div>

0 commit comments

Comments
 (0)