@@ -949,16 +949,23 @@ const tests = [
949949 options : { mode : "pure" } ,
950950 input : `/* cssmodules-pure-ignore */
951951 :global(.foo) { color: blue; }` ,
952- expected : `/* cssmodules-pure-ignore */
952+ expected : `.foo { color: blue; }` ,
953+ } ,
954+ {
955+ name : "should suppress errors for global selectors after ignore comment #2" ,
956+ options : { mode : "pure" } ,
957+ input : `/* cssmodules-pure-ignore */
958+ /* another comment */
959+ :global(.foo) { color: blue; }` ,
960+ expected : `/* another comment */
953961 .foo { color: blue; }` ,
954962 } ,
955963 {
956964 name : "should allow additional text in ignore comment" ,
957965 options : { mode : "pure" } ,
958966 input : `/* cssmodules-pure-ignore - needed for third party integration */
959967 :global(#foo) { color: blue; }` ,
960- expected : `/* cssmodules-pure-ignore - needed for third party integration */
961- #foo { color: blue; }` ,
968+ expected : `#foo { color: blue; }` ,
962969 } ,
963970 {
964971 name : "should not affect rules after the ignored block" ,
@@ -985,9 +992,7 @@ const tests = [
985992 /* cssmodules-pure-ignore */
986993 :global(.bar) { color: blue; }
987994 }` ,
988- expected : `/* cssmodules-pure-ignore */
989- .foo {
990- /* cssmodules-pure-ignore */
995+ expected : `.foo {
991996 .bar { color: blue; }
992997 }` ,
993998 } ,
@@ -998,8 +1003,7 @@ const tests = [
9981003 ::view-transition-group(modal) {
9991004 animation-duration: 300ms;
10001005 }` ,
1001- expected : `/* cssmodules-pure-ignore */
1002- ::view-transition-group(modal) {
1006+ expected : `::view-transition-group(modal) {
10031007 animation-duration: 300ms;
10041008 }` ,
10051009 } ,
@@ -1011,8 +1015,7 @@ const tests = [
10111015 from { opacity: 1; }
10121016 to { opacity: 0; }
10131017 }` ,
1014- expected : `/* cssmodules-pure-ignore */
1015- @keyframes fadeOut {
1018+ expected : `@keyframes fadeOut {
10161019 from { opacity: 1; }
10171020 to { opacity: 0; }
10181021 }` ,
@@ -1025,7 +1028,6 @@ const tests = [
10251028 :global(.foo) { color: blue; }
10261029 }` ,
10271030 expected : `@media (min-width: 768px) {
1028- /* cssmodules-pure-ignore */
10291031 .foo { color: blue; }
10301032 }` ,
10311033 } ,
@@ -1037,10 +1039,8 @@ const tests = [
10371039 .local { color: green; }
10381040 /* cssmodules-pure-ignore */
10391041 :global(.bar) { color: red; }` ,
1040- expected : `/* cssmodules-pure-ignore */
1041- .foo { color: blue; }
1042+ expected : `.foo { color: blue; }
10421043 :local(.local) { color: green; }
1043- /* cssmodules-pure-ignore */
10441044 .bar { color: red; }` ,
10451045 } ,
10461046 {
@@ -1050,8 +1050,7 @@ const tests = [
10501050 :global(.foo):hover > :global(.bar) + :global(.baz) {
10511051 color: blue;
10521052 }` ,
1053- expected : `/* cssmodules-pure-ignore */
1054- .foo:hover > .bar + .baz {
1053+ expected : `.foo:hover > .bar + .baz {
10551054 color: blue;
10561055 }` ,
10571056 } ,
@@ -1064,8 +1063,7 @@ const tests = [
10641063 :global(.baz) {
10651064 color: blue;
10661065 }` ,
1067- expected : `/* cssmodules-pure-ignore */
1068- .foo,
1066+ expected : `.foo,
10691067 .bar,
10701068 .baz {
10711069 color: blue;
@@ -1079,8 +1077,7 @@ const tests = [
10791077 :global(.foo)::after {
10801078 content: '';
10811079 }` ,
1082- expected : `/* cssmodules-pure-ignore */
1083- .foo::before,
1080+ expected : `.foo::before,
10841081 .foo::after {
10851082 content: '';
10861083 }` ,
0 commit comments