File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ Declarations (mode `local`, by default):
5959In pure mode, all selectors must contain at least one local class or id
6060selector
6161
62- To ignore this rule for a specific selector, add the following comment in front
62+ To ignore this rule for a specific selector, add the a ` /* cssmodules-pure-ignore */ ` comment in front
6363of the selector:
6464
6565``` css
@@ -69,6 +69,20 @@ of the selector:
6969}
7070```
7171
72+ or by adding a ` /* cssmodules-pure-no-check */ ` comment at the top of a file to disable this check for the whole file:
73+
74+ ``` css
75+ /* cssmodules-pure-no-check */
76+
77+ :global(#modal-backdrop ) {
78+ ...;
79+ }
80+
81+ :global(#my-id ) {
82+ ...;
83+ }
84+ ```
85+
7286## Building
7387
7488``` bash
Original file line number Diff line number Diff line change @@ -1213,6 +1213,15 @@ const tests = [
12131213 /* cssmodules-pure-no-check */` ,
12141214 error : / i s n o t p u r e / ,
12151215 } ,
1216+ {
1217+ name : "should ignore no-check comment if not at root level #2" ,
1218+ options : { mode : "pure" } ,
1219+ input : `/* Some file description */
1220+ .class { color: red; }
1221+ /* cssmodules-pure-no-check */
1222+ :global(.foo) { color: blue }` ,
1223+ error : / i s n o t p u r e / ,
1224+ } ,
12161225 {
12171226 name : "should allow other comments before no-check comment" ,
12181227 options : { mode : "pure" } ,
You can’t perform that action at this time.
0 commit comments