Skip to content

Commit 8c09682

Browse files
authored
Fix nthChild example (ast-grep#609)
was incorrect, didn't match playground
1 parent 0ff7143 commit 8c09682

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

website/guide/rule-config/atomic-rule.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ The [following rule](/playground.html#eyJtb2RlIjoiQ29uZmlnIiwibGFuZyI6ImphdmFzY3
177177
```yaml
178178
rule:
179179
kind: number
180-
nthChild: 1
180+
nthChild: 2
181181
```
182182

183183
It will match the following code:
@@ -224,4 +224,4 @@ const foo = () => {
224224
The first step to compose a rule is to find the target. In this case, we can first use kind: `arrow_function` to find function node. Then we can use other rules to filter candidate nodes that does have return type.
225225

226226
Another trick to write cleaner rule is to use sub-rules as fields.
227-
Please refer to [composite rule](/guide/rule-config/composite-rule.html#combine-different-rules-as-fields) for more details.
227+
Please refer to [composite rule](/guide/rule-config/composite-rule.html#combine-different-rules-as-fields) for more details.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy