Skip to content

Commit e2e8466

Browse files
authored
Add espree example
Closes GH-4. Reviewed-by: Titus Wormer <[email protected]>
1 parent 9b2803e commit e2e8466

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

readme.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,17 @@ a(
6969
Note that the lines are added by `recast` in this case.
7070
And, some of these weird comments are off, but they’re pretty close.
7171

72+
With espree:
73+
74+
```js
75+
import espree from 'espree'
76+
import {attachComments} from 'estree-util-attach-comments'
77+
78+
var tree = espree.parse(code, {comment: true, ecmaVersion: 2020})
79+
80+
attachComments(tree, tree.comments)
81+
```
82+
7283
## API
7384

7485
This package exports the following identifiers: `attachComments`.

0 commit comments

Comments
 (0)