feat: manually mirror opencoze's code from bytedance
Change-Id: I09a73aadda978ad9511264a756b2ce51f5761adf
This commit is contained in:
54
frontend/config/stylelint-config/examples/class-pattern.less
Normal file
54
frontend/config/stylelint-config/examples/class-pattern.less
Normal file
@@ -0,0 +1,54 @@
|
||||
// bad
|
||||
.a1_b1_c1 {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
// bad
|
||||
.a2-b2_c2-d2 {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
// bad
|
||||
.a3-b3_c3_d3 {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
// bad
|
||||
.a4-b4 {
|
||||
&_c4_d4 {
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
|
||||
// bad
|
||||
.a5-cammelCase {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
// good
|
||||
.a5-b5-c5 {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
// good
|
||||
.a6-b6-c6_d6 {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
// good
|
||||
.a7_b7 {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
// good
|
||||
.a8 {
|
||||
&-b8 {
|
||||
&-c8 {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
&_d8 {
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
// bad
|
||||
// bad
|
||||
/* stylelint-disable plugin/disallow-first-level-global */
|
||||
:global {
|
||||
.semi-button {
|
||||
width: 300px;
|
||||
}
|
||||
}
|
||||
|
||||
// ok
|
||||
.a {
|
||||
:global {
|
||||
.semi-button {
|
||||
width: 300px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
// bad
|
||||
.a1 {
|
||||
.b1 {
|
||||
.c1 {
|
||||
.d1 {
|
||||
.e1 {
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// good
|
||||
.a2 .b2 .c2 .d2 .e2 {
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
// still good
|
||||
.a3 .b3 {
|
||||
.c3 {
|
||||
.d3 {
|
||||
.e3 {
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
10
frontend/config/stylelint-config/examples/no-important.less
Normal file
10
frontend/config/stylelint-config/examples/no-important.less
Normal file
@@ -0,0 +1,10 @@
|
||||
// avoid
|
||||
.a {
|
||||
opacity: 0 !important;
|
||||
}
|
||||
|
||||
// if you have to
|
||||
.b {
|
||||
/* stylelint-disable-next-line declaration-no-important */
|
||||
opacity: 0 !important;
|
||||
}
|
||||
Reference in New Issue
Block a user