Skip to content

Commit 11e76fc

Browse files
Trottdanielleadams
authored andcommitted
test: remove lint rule for setTimeout() arguments
With the introduction of the promises API for setTimeout(), the requirement that it have two parameters may not be sensible anymore in tests. PR-URL: #41901 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 914f907 commit 11e76fc

File tree

3 files changed

+0
-10
lines changed

3 files changed

+0
-10
lines changed

test/.eslintrc.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ rules:
3131
message: "Use an object as second argument of `assert.throws()`."
3232
- selector: "CallExpression:matches([callee.name='throws'], [callee.property.name='throws'])[arguments.length<2]"
3333
message: "`assert.throws()` must be invoked with at least two arguments."
34-
- selector: "CallExpression[callee.name='setTimeout'][arguments.length<2]"
35-
message: "`setTimeout()` must be invoked with at least two arguments."
3634
- selector: "CallExpression[callee.name='setInterval'][arguments.length<2]"
3735
message: "`setInterval()` must be invoked with at least two arguments."
3836
- selector: "ThrowStatement > CallExpression[callee.name=/Error$/]"

test/parallel/test-stream-construct-async-error.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const assert = require('assert');
1212
{
1313
class Foo extends Duplex {
1414
async _destroy(err, cb) {
15-
// eslint-disable-next-line no-restricted-syntax
1615
await setTimeout(common.platformTimeout(1));
1716
throw new Error('boom');
1817
}
@@ -31,7 +30,6 @@ const assert = require('assert');
3130
{
3231
class Foo extends Duplex {
3332
async _destroy(err, cb) {
34-
// eslint-disable-next-line no-restricted-syntax
3533
await setTimeout(common.platformTimeout(1));
3634
}
3735
}
@@ -46,7 +44,6 @@ const assert = require('assert');
4644
{
4745
class Foo extends Duplex {
4846
async _construct() {
49-
// eslint-disable-next-line no-restricted-syntax
5047
await setTimeout(common.platformTimeout(1));
5148
}
5249

@@ -64,7 +61,6 @@ const assert = require('assert');
6461
{
6562
class Foo extends Duplex {
6663
async _construct(callback) {
67-
// eslint-disable-next-line no-restricted-syntax
6864
await setTimeout(common.platformTimeout(1));
6965
callback();
7066
}
@@ -88,7 +84,6 @@ const assert = require('assert');
8884
});
8985

9086
async _final() {
91-
// eslint-disable-next-line no-restricted-syntax
9287
await setTimeout(common.platformTimeout(1));
9388
}
9489
}
@@ -105,7 +100,6 @@ const assert = require('assert');
105100
});
106101

107102
async _final(callback) {
108-
// eslint-disable-next-line no-restricted-syntax
109103
await setTimeout(common.platformTimeout(1));
110104
callback();
111105
}
@@ -123,7 +117,6 @@ const assert = require('assert');
123117
});
124118

125119
async _final() {
126-
// eslint-disable-next-line no-restricted-syntax
127120
await setTimeout(common.platformTimeout(1));
128121
throw new Error('boom');
129122
}

test/parallel/test-stream-writable-final-async.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const { setTimeout } = require('timers/promises');
99
{
1010
class Foo extends Duplex {
1111
async _final(callback) {
12-
// eslint-disable-next-line no-restricted-syntax
1312
await setTimeout(common.platformTimeout(1));
1413
callback();
1514
}

0 commit comments

Comments
 (0)