File tree 3 files changed +7
-8
lines changed 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,6 @@ const emptyComments = []
54
54
* @returns {undefined }
55
55
* Nothing.
56
56
*/
57
- // To do: next major: don’t return given `tree`.
58
57
export function attachComments ( tree , comments ) {
59
58
const list = comments ? [ ...comments ] . sort ( compare ) : emptyComments
60
59
if ( list . length > 0 ) walk ( tree , { comments : list , index : 0 } )
Original file line number Diff line number Diff line change 26
26
],
27
27
"sideEffects" : false ,
28
28
"type" : " module" ,
29
- "main" : " index.js" ,
30
- "types" : " index.d.ts" ,
29
+ "exports" : " ./index.js" ,
31
30
"files" : [
32
31
" lib/" ,
33
32
" index.d.ts" ,
Original file line number Diff line number Diff line change 7
7
import assert from 'node:assert/strict'
8
8
import test from 'node:test'
9
9
import { parse as acornParse } from 'acorn'
10
- import recast from 'recast '
10
+ import { attachComments } from 'estree-util-attach-comments '
11
11
import { visit } from 'estree-util-visit'
12
- import { attachComments } from './index.js '
12
+ import recast from 'recast '
13
13
14
14
test ( 'attachComments' , async function ( t ) {
15
15
await t . test ( 'should expose the public api' , async function ( ) {
16
- assert . deepEqual ( Object . keys ( await import ( './index.js' ) ) . sort ( ) , [
17
- 'attachComments'
18
- ] )
16
+ assert . deepEqual (
17
+ Object . keys ( await import ( 'estree-util-attach-comments' ) ) . sort ( ) ,
18
+ [ 'attachComments' ]
19
+ )
19
20
} )
20
21
21
22
await t . test ( 'should support an empty document' , async function ( ) {
You can’t perform that action at this time.
0 commit comments