Skip to content

Commit

Permalink
test(consistent-selector-style): added rule tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marekdedic committed Dec 5, 2024
1 parent 882fd80 commit e963ca7
Show file tree
Hide file tree
Showing 15 changed files with 301 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"options": [{ "style": ["class", "id", "type"] }]
}
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>
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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"options": [{ "style": ["class", "type", "id"] }]
}
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>
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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"options": [{ "style": ["id", "class", "type"] }]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<a class="link">Click me!</a>

<a class="link">Click me two!</a>

<b class="bold">Text 1</b>

<b class="bold">Text 2</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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<a id="link">Click me!</a>

<b id="bold">Text 1</b>

<b>Text 2</b>

<style lang="scss">
#link {
color: red;
}
#bold {
color: red;
}
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<a id="link">Click me!</a>

<b id="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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"options": [{ "style": ["id", "type", "class"] }]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<a class="link">Click me!</a>

<span class="link">Click me two!</span>

<b class="bold">Text 1</b>

<strong class="bold">Text 2</strong>

<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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<a id="link">Click me!</a>

<b id="bold">Text 1</b>

<b>Text 2</b>

<style lang="scss">
#link {
color: red;
}
#bold {
color: red;
}
</style>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<a id="link">Click me!</a>

<b id="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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<a>Click me!</a>

<a>Click me two!</a>

<b>Text 1</b>

<b>Text 2</b>

<b data-key="val">Text 2</b>

<style>
a {
color: red;
}
b {
color: red;
}
a:active {
color: red;
}
a + b {
color: red;
}
b[data-key="val"] {
color: red;
}
b::before {
color: red;
}
</style>

0 comments on commit e963ca7

Please sign in to comment.