Skip to content

Commit 3b06fd9

Browse files
committed
test(consistent-selector-style): Added tests for repeated elements
1 parent 04ca0d1 commit 3b06fd9

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

packages/eslint-plugin-svelte/tests/fixtures/rules/consistent-selector-style/valid/id-class-type/class01-input.svelte

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@
1010

1111
<b class:conditional={true}>Text 3</b>
1212

13+
{#each ["one", "two"] as iter}
14+
<span class="iterated-each">{iter}</span>
15+
{/each}
16+
17+
{#snippet iterated()}
18+
<span class="iterated-snippet">Text 4</span>
19+
{/snippet}
20+
21+
<CustomComponent>
22+
<span class="iterated-component">Text 5</span>
23+
</CustomComponent>
24+
1325
<style>
1426
.link {
1527
color: red;
@@ -38,4 +50,16 @@
3850
.conditional {
3951
color: red;
4052
}
53+
54+
.iterated-each {
55+
color: red;
56+
}
57+
58+
.iterated-snippet {
59+
color: red;
60+
}
61+
62+
.iterated-component {
63+
color: red;
64+
}
4165
</style>

packages/eslint-plugin-svelte/tests/fixtures/rules/consistent-selector-style/valid/type-id-class/class-dynamic-suffix01-input.svelte

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919

2020
<a class={derived}>Click me four!</a>
2121

22+
{#each ["one", "two"] as count}
23+
<b class={"bold-" + count}>Bold in each</b>
24+
{/each}
25+
2226
<style>
2327
.foo-link-one {
2428
color: red;
@@ -31,4 +35,12 @@
3135
.foo-link-three {
3236
color: red;
3337
}
38+
39+
.bold-one {
40+
color: red;
41+
}
42+
43+
.bold-two {
44+
color: blue;
45+
}
3446
</style>

0 commit comments

Comments
 (0)