Commit 62a5b85
authored
Improve
* tests: Normalize expected and actual strings to reduce noise
* style: Add @ts-check and JSDoc type definitions to surface errors
* tests: Add more passing tests
* tests: Add failing tests for valid uses of `@at-root`
* style: Rename functions and variables for clarity
* rafactor: Resolve non-critical/false-positive type-checking issues
* fix: Logic/typing error when handling @at-root rules
* refactor: Simplify existing logic
* fix: Move all preceeding comments with rule
* fix: `@layer` blocks should also bubble
* fix: Correctly handle `with`/`without` parameters on `@at-root`
* feat: Add option `rootRuleName` to rename the custom `@at-root` rule
* style: Auto formatting/linting
* fix: Remove hasRootRule optimization
* fix: Add back hasRootRule optimization, scoped to root node
As per examples given in the postcss docs:
https://github.com/postcss/postcss/blob/main/docs/writing-a-plugin.md#step-4-change-nodes
* docs: Update README
* style: Reformat test input
* tests: Add more `@at-rule` test, some failing
* fix: Failing `@at-root` edge cases
* style: Fix typo in function name, remove console.log
* refactor: Remove @ts-check hack code path, use type assertion instead
* test: Remove comments
* refactor: Use root#walkAtRules
* chore: Tweak eslint rule value
* refactor: Fix linting errors …
Not sure how/why this didn't show up yesterday or the day before.
VSCode's ESLint plugin must have silently crashed or something.@at-root behavior (#147)1 parent 2e52ada commit 62a5b85
6 files changed
Lines changed: 882 additions & 102 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
4 | 12 | | |
5 | 13 | | |
6 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | | - | |
| 122 | + | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
27 | 34 | | |
28 | 35 | | |
29 | 36 | | |
| |||
0 commit comments