@@ -881,16 +881,23 @@ const tests = [
881881 options : { mode : "pure" } ,
882882 input : `/* cssmodules-pure-ignore */
883883 :global(.foo) { color: blue; }` ,
884- expected : `/* cssmodules-pure-ignore */
884+ expected : `.foo { color: blue; }` ,
885+ } ,
886+ {
887+ name : "should suppress errors for global selectors after ignore comment #2" ,
888+ options : { mode : "pure" } ,
889+ input : `/* cssmodules-pure-ignore */
890+ /* another comment */
891+ :global(.foo) { color: blue; }` ,
892+ expected : `/* another comment */
885893 .foo { color: blue; }` ,
886894 } ,
887895 {
888896 name : "should allow additional text in ignore comment" ,
889897 options : { mode : "pure" } ,
890898 input : `/* cssmodules-pure-ignore - needed for third party integration */
891899 :global(#foo) { color: blue; }` ,
892- expected : `/* cssmodules-pure-ignore - needed for third party integration */
893- #foo { color: blue; }` ,
900+ expected : `#foo { color: blue; }` ,
894901 } ,
895902 {
896903 name : "should not affect rules after the ignored block" ,
@@ -917,9 +924,7 @@ const tests = [
917924 /* cssmodules-pure-ignore */
918925 :global(.bar) { color: blue; }
919926 }` ,
920- expected : `/* cssmodules-pure-ignore */
921- .foo {
922- /* cssmodules-pure-ignore */
927+ expected : `.foo {
923928 .bar { color: blue; }
924929 }` ,
925930 } ,
@@ -930,8 +935,7 @@ const tests = [
930935 ::view-transition-group(modal) {
931936 animation-duration: 300ms;
932937 }` ,
933- expected : `/* cssmodules-pure-ignore */
934- ::view-transition-group(modal) {
938+ expected : `::view-transition-group(modal) {
935939 animation-duration: 300ms;
936940 }` ,
937941 } ,
@@ -943,8 +947,7 @@ const tests = [
943947 from { opacity: 1; }
944948 to { opacity: 0; }
945949 }` ,
946- expected : `/* cssmodules-pure-ignore */
947- @keyframes fadeOut {
950+ expected : `@keyframes fadeOut {
948951 from { opacity: 1; }
949952 to { opacity: 0; }
950953 }` ,
@@ -957,7 +960,6 @@ const tests = [
957960 :global(.foo) { color: blue; }
958961 }` ,
959962 expected : `@media (min-width: 768px) {
960- /* cssmodules-pure-ignore */
961963 .foo { color: blue; }
962964 }` ,
963965 } ,
@@ -969,10 +971,8 @@ const tests = [
969971 .local { color: green; }
970972 /* cssmodules-pure-ignore */
971973 :global(.bar) { color: red; }` ,
972- expected : `/* cssmodules-pure-ignore */
973- .foo { color: blue; }
974+ expected : `.foo { color: blue; }
974975 :local(.local) { color: green; }
975- /* cssmodules-pure-ignore */
976976 .bar { color: red; }` ,
977977 } ,
978978 {
@@ -982,8 +982,7 @@ const tests = [
982982 :global(.foo):hover > :global(.bar) + :global(.baz) {
983983 color: blue;
984984 }` ,
985- expected : `/* cssmodules-pure-ignore */
986- .foo:hover > .bar + .baz {
985+ expected : `.foo:hover > .bar + .baz {
987986 color: blue;
988987 }` ,
989988 } ,
@@ -996,8 +995,7 @@ const tests = [
996995 :global(.baz) {
997996 color: blue;
998997 }` ,
999- expected : `/* cssmodules-pure-ignore */
1000- .foo,
998+ expected : `.foo,
1001999 .bar,
10021000 .baz {
10031001 color: blue;
@@ -1011,8 +1009,7 @@ const tests = [
10111009 :global(.foo)::after {
10121010 content: '';
10131011 }` ,
1014- expected : `/* cssmodules-pure-ignore */
1015- .foo::before,
1012+ expected : `.foo::before,
10161013 .foo::after {
10171014 content: '';
10181015 }` ,
0 commit comments