File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed
Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,6 @@ const emptyComments = []
5454 * @returns {undefined }
5555 * Nothing.
5656 */
57- // To do: next major: don’t return given `tree`.
5857export function attachComments ( tree , comments ) {
5958 const list = comments ? [ ...comments ] . sort ( compare ) : emptyComments
6059 if ( list . length > 0 ) walk ( tree , { comments : list , index : 0 } )
Original file line number Diff line number Diff line change 2626 ],
2727 "sideEffects" : false ,
2828 "type" : " module" ,
29- "main" : " index.js" ,
30- "types" : " index.d.ts" ,
29+ "exports" : " ./index.js" ,
3130 "files" : [
3231 " lib/" ,
3332 " index.d.ts" ,
Original file line number Diff line number Diff line change 77import assert from 'node:assert/strict'
88import test from 'node:test'
99import { parse as acornParse } from 'acorn'
10- import recast from 'recast '
10+ import { attachComments } from 'estree-util-attach-comments '
1111import { visit } from 'estree-util-visit'
12- import { attachComments } from './index.js '
12+ import recast from 'recast '
1313
1414test ( 'attachComments' , async function ( t ) {
1515 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+ )
1920 } )
2021
2122 await t . test ( 'should support an empty document' , async function ( ) {
You can’t perform that action at this time.
0 commit comments