-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(consistent-selector-style): added rule tests
- Loading branch information
1 parent
882fd80
commit be7ca3c
Showing
35 changed files
with
814 additions
and
0 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
...-svelte/tests/fixtures/rules/consistent-selector-style/invalid/id-class-type/_config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"options": [{ "style": ["id", "class", "type"] }] | ||
} |
24 changes: 24 additions & 0 deletions
24
...s/consistent-selector-style/invalid/id-class-type/should-be-id-combination01-input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<a class="link">Click me!</a> | ||
|
||
<a>Click me two!</a> | ||
|
||
<b class="bold">Text 1</b> | ||
|
||
<b data-key="val">Text 3</b> | ||
|
||
<i>Italic</i> | ||
|
||
<style> | ||
.link, | ||
.bold, | ||
.link:active, | ||
.link + .bold, | ||
.bold[data-key="val"], | ||
.bold::before, | ||
i, | ||
i:active, | ||
#bold + i, | ||
i::before { | ||
color: red; | ||
} | ||
</style> |
51 changes: 51 additions & 0 deletions
51
...ixtures/rules/consistent-selector-style/invalid/id-class-type/should-be-id01-input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<a class="link">Click me!</a> | ||
|
||
<a>Click me two!</a> | ||
|
||
<b class="bold">Text 1</b> | ||
|
||
<b data-key="val">Text 3</b> | ||
|
||
<i>Italic</i> | ||
|
||
<style> | ||
.link { | ||
color: red; | ||
} | ||
.bold { | ||
color: red; | ||
} | ||
.link:active { | ||
color: red; | ||
} | ||
.link + .bold { | ||
color: red; | ||
} | ||
.bold[data-key="val"] { | ||
color: red; | ||
} | ||
.bold::before { | ||
color: red; | ||
} | ||
i { | ||
color: red; | ||
} | ||
i:active { | ||
color: red; | ||
} | ||
#bold + i { | ||
color: red; | ||
} | ||
i::before { | ||
color: red; | ||
} | ||
</style> |
3 changes: 3 additions & 0 deletions
3
...-svelte/tests/fixtures/rules/consistent-selector-style/invalid/id-type-class/_config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"options": [{ "style": ["id", "type", "class"] }] | ||
} |
51 changes: 51 additions & 0 deletions
51
...ixtures/rules/consistent-selector-style/invalid/id-type-class/should-be-id01-input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<a class="link">Click me!</a> | ||
|
||
<a>Click me two!</a> | ||
|
||
<b class="bold">Text 1</b> | ||
|
||
<b data-key="val">Text 3</b> | ||
|
||
<i>Italic</i> | ||
|
||
<style> | ||
.link { | ||
color: red; | ||
} | ||
.bold { | ||
color: red; | ||
} | ||
.link:active { | ||
color: red; | ||
} | ||
.link + .bold { | ||
color: red; | ||
} | ||
.bold[data-key="val"] { | ||
color: red; | ||
} | ||
.bold::before { | ||
color: red; | ||
} | ||
i { | ||
color: red; | ||
} | ||
i:active { | ||
color: red; | ||
} | ||
#bold + i { | ||
color: red; | ||
} | ||
i::before { | ||
color: red; | ||
} | ||
</style> |
33 changes: 33 additions & 0 deletions
33
...tures/rules/consistent-selector-style/invalid/id-type-class/should-be-type01-input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<a class="link">Click me!</a> | ||
|
||
<a class="link">Click me two!</a> | ||
|
||
<b class="bold">Text 1</b> | ||
|
||
<b class="bold" data-key="val">Text 2</b> | ||
|
||
<style> | ||
.link { | ||
color: red; | ||
} | ||
.bold { | ||
color: red; | ||
} | ||
.link:active { | ||
color: red; | ||
} | ||
.link + .bold { | ||
color: red; | ||
} | ||
.bold[data-key="val"] { | ||
color: red; | ||
} | ||
.bold::before { | ||
color: red; | ||
} | ||
</style> |
3 changes: 3 additions & 0 deletions
3
...-svelte/tests/fixtures/rules/consistent-selector-style/invalid/type-class-id/_config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"options": [{ "style": ["type", "class", "id"] }] | ||
} |
51 changes: 51 additions & 0 deletions
51
...tures/rules/consistent-selector-style/invalid/type-class-id/should-be-type01-input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<a class="link">Click me!</a> | ||
|
||
<a class="link">Click me two!</a> | ||
|
||
<b class="bold">Text 1</b> | ||
|
||
<b class="bold" data-key="val">Text 2</b> | ||
|
||
<i id="italic">Italic</i> | ||
|
||
<style> | ||
.link { | ||
color: red; | ||
} | ||
.bold { | ||
color: red; | ||
} | ||
.link:active { | ||
color: red; | ||
} | ||
.link + .bold { | ||
color: red; | ||
} | ||
.bold[data-key="val"] { | ||
color: red; | ||
} | ||
.bold::before { | ||
color: red; | ||
} | ||
#italic { | ||
color: red; | ||
} | ||
#italic:active { | ||
color: red; | ||
} | ||
b + #italic { | ||
color: red; | ||
} | ||
#italic::before { | ||
color: red; | ||
} | ||
</style> |
3 changes: 3 additions & 0 deletions
3
...-svelte/tests/fixtures/rules/consistent-selector-style/invalid/type-id-class/_config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"options": [{ "style": ["type", "id", "class"] }] | ||
} |
33 changes: 33 additions & 0 deletions
33
...ixtures/rules/consistent-selector-style/invalid/type-id-class/should-be-id01-input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<a class="link">Click me!</a> | ||
|
||
<a>Click me two!</a> | ||
|
||
<b class="bold">Text 1</b> | ||
|
||
<b data-key="val">Text 3</b> | ||
|
||
<style> | ||
.link { | ||
color: red; | ||
} | ||
.bold { | ||
color: red; | ||
} | ||
.link:active { | ||
color: red; | ||
} | ||
.link + .bold { | ||
color: red; | ||
} | ||
.bold[data-key="val"] { | ||
color: red; | ||
} | ||
.bold::before { | ||
color: red; | ||
} | ||
</style> |
51 changes: 51 additions & 0 deletions
51
...tures/rules/consistent-selector-style/invalid/type-id-class/should-be-type01-input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<a class="link">Click me!</a> | ||
|
||
<a class="link">Click me two!</a> | ||
|
||
<b class="bold">Text 1</b> | ||
|
||
<b class="bold" data-key="val">Text 2</b> | ||
|
||
<i id="italic">Italic</i> | ||
|
||
<style> | ||
.link { | ||
color: red; | ||
} | ||
.bold { | ||
color: red; | ||
} | ||
.link:active { | ||
color: red; | ||
} | ||
.link + .bold { | ||
color: red; | ||
} | ||
.bold[data-key="val"] { | ||
color: red; | ||
} | ||
.bold::before { | ||
color: red; | ||
} | ||
#italic { | ||
color: red; | ||
} | ||
#italic:active { | ||
color: red; | ||
} | ||
b + #italic { | ||
color: red; | ||
} | ||
#italic::before { | ||
color: red; | ||
} | ||
</style> |
3 changes: 3 additions & 0 deletions
3
...in-svelte/tests/fixtures/rules/consistent-selector-style/valid/class-id-type/_config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"options": [{ "style": ["class", "id", "type"] }] | ||
} |
15 changes: 15 additions & 0 deletions
15
...ts/fixtures/rules/consistent-selector-style/valid/class-id-type/class-scss01-input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<a class="link">Click me!</a> | ||
|
||
<b class="bold">Text 1</b> | ||
|
||
<b>Text 2</b> | ||
|
||
<style lang="scss"> | ||
.link { | ||
color: red; | ||
} | ||
.bold { | ||
color: red; | ||
} | ||
</style> |
31 changes: 31 additions & 0 deletions
31
...e/tests/fixtures/rules/consistent-selector-style/valid/class-id-type/class01-input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<a class="link">Click me!</a> | ||
|
||
<b class="bold">Text 1</b> | ||
|
||
<b data-key="val">Text 2</b> | ||
|
||
<style> | ||
.link { | ||
color: red; | ||
} | ||
.bold { | ||
color: red; | ||
} | ||
.link:active { | ||
color: red; | ||
} | ||
.link + .bold { | ||
color: red; | ||
} | ||
.bold[data-key="val"] { | ||
color: red; | ||
} | ||
.bold::before { | ||
color: red; | ||
} | ||
</style> |
3 changes: 3 additions & 0 deletions
3
...in-svelte/tests/fixtures/rules/consistent-selector-style/valid/class-type-id/_config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"options": [{ "style": ["class", "type", "id"] }] | ||
} |
15 changes: 15 additions & 0 deletions
15
...ts/fixtures/rules/consistent-selector-style/valid/class-type-id/class-scss01-input.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<a class="link">Click me!</a> | ||
|
||
<b class="bold">Text 1</b> | ||
|
||
<b>Text 2</b> | ||
|
||
<style lang="scss"> | ||
.link { | ||
color: red; | ||
} | ||
.bold { | ||
color: red; | ||
} | ||
</style> |
Oops, something went wrong.