Skip to content

Commit 10e86dc

Browse files
docs: improvement
1 parent 20ffc3d commit 10e86dc

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Declarations (mode `local`, by default):
5959
In pure mode, all selectors must contain at least one local class or id
6060
selector
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
6363
of 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

test/index.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,6 +1213,15 @@ const tests = [
12131213
/* cssmodules-pure-no-check */`,
12141214
error: /is not pure/,
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: /is not pure/,
1224+
},
12161225
{
12171226
name: "should allow other comments before no-check comment",
12181227
options: { mode: "pure" },

0 commit comments

Comments
 (0)