Skip to content

Commit 2bf62d0

Browse files
committed
Update dev-dependencies
1 parent 5b743be commit 2bf62d0

File tree

3 files changed

+20
-26
lines changed

3 files changed

+20
-26
lines changed

index.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
var push = [].push
2-
31
/**
42
* @typedef {import('estree').BaseNode} EstreeNode
53
* @typedef {import('estree').Comment} EstreeComment
@@ -72,10 +70,7 @@ function walk(node, state) {
7270
children.sort(compare)
7371

7472
// Initial comments.
75-
push.apply(
76-
comments,
77-
slice(state, node, false, {leading: true, trailing: false})
78-
)
73+
comments.push(...slice(state, node, false, {leading: true, trailing: false}))
7974

8075
index = -1
8176

@@ -84,16 +79,15 @@ function walk(node, state) {
8479
}
8580

8681
// Dangling or trailing comments.
87-
push.apply(
88-
comments,
89-
slice(state, node, true, {
82+
comments.push(
83+
...slice(state, node, true, {
9084
leading: false,
9185
trailing: Boolean(children.length)
9286
})
9387
)
9488

9589
if (comments.length) {
96-
// @ts-ignore, yes, because they’re nonstandard.
90+
// @ts-expect-error, yes, because they’re nonstandard.
9791
node.comments = comments
9892
}
9993
}
@@ -143,7 +137,7 @@ function compare(left, right, compareEnd) {
143137
// Just `start` (and `end`) on nodes.
144138
// Default in most parsers.
145139
if ('start' in left && field in right) {
146-
// @ts-ignore Added by Acorn
140+
// @ts-expect-error Added by Acorn
147141
return left.start - right[field]
148142
}
149143

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"tape": "^5.0.0",
5050
"type-coverage": "^2.0.0",
5151
"typescript": "^4.0.0",
52-
"xo": "^0.38.0"
52+
"xo": "^0.39.0"
5353
},
5454
"scripts": {
5555
"prepack": "npm run build && npm run format",

test.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ test('estree-attach-comments (recast)', function (t) {
8181
/** @type {EstreeComment[]} */
8282
var comments = []
8383
/** @type {EstreeProgram} */
84-
// @ts-ignore
84+
// @ts-expect-error
8585
var tree = acornParse('/* 1 */ a /* 2 */ + /* 3 */ 1', {
8686
ecmaVersion: 2020,
87-
// @ts-ignore
87+
// @ts-expect-error
8888
onComment: comments
8989
})
9090

@@ -97,10 +97,10 @@ test('estree-attach-comments (recast)', function (t) {
9797
)
9898

9999
comments = []
100-
// @ts-ignore
100+
// @ts-expect-error
101101
tree = acornParse('1 + 1', {
102102
ecmaVersion: 2020,
103-
// @ts-ignore
103+
// @ts-expect-error
104104
onComment: comments
105105
})
106106

@@ -112,10 +112,10 @@ test('estree-attach-comments (recast)', function (t) {
112112

113113
comments = []
114114
/** @type {EstreeProgram} */
115-
// @ts-ignore
115+
// @ts-expect-error
116116
tree = acornParse('/* 1 */ a /* 2 */ + /* 3 */ 1', {
117117
ecmaVersion: 2020,
118-
// @ts-ignore
118+
// @ts-expect-error
119119
onComment: comments
120120
})
121121

@@ -128,11 +128,11 @@ test('estree-attach-comments (recast)', function (t) {
128128
)
129129

130130
comments = []
131-
// @ts-ignore
131+
// @ts-expect-error
132132
tree = acornParse('/* 1 */ a /* 2 */ + /* 3 */ 1', {
133133
ecmaVersion: 2020,
134134
ranges: true,
135-
// @ts-ignore
135+
// @ts-expect-error
136136
onComment: comments
137137
})
138138

@@ -145,11 +145,11 @@ test('estree-attach-comments (recast)', function (t) {
145145
)
146146

147147
comments = []
148-
// @ts-ignore
148+
// @ts-expect-error
149149
tree = acornParse('/* 1 */ a /* 2 */ + /* 3 */ 1', {
150150
ecmaVersion: 2020,
151151
locations: true,
152-
// @ts-ignore
152+
// @ts-expect-error
153153
onComment: comments
154154
})
155155

@@ -172,7 +172,7 @@ function parse(doc) {
172172
/** @type {EstreeComment[]} */
173173
var comments = []
174174
/** @type {EstreeProgram} */
175-
// @ts-ignore
175+
// @ts-expect-error
176176
var tree = acornParse(doc, {ecmaVersion: 2020, onComment: comments})
177177
return [tree, comments]
178178
}
@@ -182,16 +182,16 @@ function parse(doc) {
182182
* @returns {void}
183183
*/
184184
function removePositions(value) {
185-
// @ts-ignore
186185
visit(
186+
// @ts-expect-error
187187
value,
188188
/**
189189
* @param {EstreeNode} node
190190
*/
191191
function (node) {
192-
// @ts-ignore they most certainly exist.
192+
// @ts-expect-error they most certainly exist.
193193
delete node.start
194-
// @ts-ignore they most certainly exist.
194+
// @ts-expect-error they most certainly exist.
195195
delete node.end
196196
}
197197
)

0 commit comments

Comments
 (0)