Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: remove lint rule for setTimeout() arguments #41901

Merged
merged 1 commit into from Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions test/.eslintrc.yaml
Expand Up @@ -31,8 +31,6 @@ rules:
message: "Use an object as second argument of `assert.throws()`."
- selector: "CallExpression:matches([callee.name='throws'], [callee.property.name='throws'])[arguments.length<2]"
message: "`assert.throws()` must be invoked with at least two arguments."
- selector: "CallExpression[callee.name='setTimeout'][arguments.length<2]"
message: "`setTimeout()` must be invoked with at least two arguments."
- selector: "CallExpression[callee.name='setInterval'][arguments.length<2]"
message: "`setInterval()` must be invoked with at least two arguments."
- selector: "ThrowStatement > CallExpression[callee.name=/Error$/]"
Expand Down
7 changes: 0 additions & 7 deletions test/parallel/test-stream-construct-async-error.js
Expand Up @@ -12,7 +12,6 @@ const assert = require('assert');
{
class Foo extends Duplex {
async _destroy(err, cb) {
// eslint-disable-next-line no-restricted-syntax
await setTimeout(common.platformTimeout(1));
throw new Error('boom');
}
Expand All @@ -31,7 +30,6 @@ const assert = require('assert');
{
class Foo extends Duplex {
async _destroy(err, cb) {
// eslint-disable-next-line no-restricted-syntax
await setTimeout(common.platformTimeout(1));
}
}
Expand All @@ -46,7 +44,6 @@ const assert = require('assert');
{
class Foo extends Duplex {
async _construct() {
// eslint-disable-next-line no-restricted-syntax
await setTimeout(common.platformTimeout(1));
}

Expand All @@ -64,7 +61,6 @@ const assert = require('assert');
{
class Foo extends Duplex {
async _construct(callback) {
// eslint-disable-next-line no-restricted-syntax
await setTimeout(common.platformTimeout(1));
callback();
}
Expand All @@ -88,7 +84,6 @@ const assert = require('assert');
});

async _final() {
// eslint-disable-next-line no-restricted-syntax
await setTimeout(common.platformTimeout(1));
}
}
Expand All @@ -105,7 +100,6 @@ const assert = require('assert');
});

async _final(callback) {
// eslint-disable-next-line no-restricted-syntax
await setTimeout(common.platformTimeout(1));
callback();
}
Expand All @@ -123,7 +117,6 @@ const assert = require('assert');
});

async _final() {
// eslint-disable-next-line no-restricted-syntax
await setTimeout(common.platformTimeout(1));
throw new Error('boom');
}
Expand Down
2 changes: 0 additions & 2 deletions test/parallel/test-stream-some-find-every.mjs
Expand Up @@ -59,7 +59,6 @@ function oneTo5Async() {

{
async function checkDestroyed(stream) {
// eslint-disable-next-line no-restricted-syntax
await setTimeout();
assert.strictEqual(stream.destroyed, true);
}
Expand Down Expand Up @@ -109,7 +108,6 @@ function oneTo5Async() {
// Concurrency doesn't affect which value is found.
const found = await Readable.from([1, 2]).find(async (val) => {
if (val === 1) {
// eslint-disable-next-line no-restricted-syntax
await setTimeout(100);
}
return true;
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-stream-writable-final-async.js
Expand Up @@ -9,7 +9,6 @@ const { setTimeout } = require('timers/promises');
{
class Foo extends Duplex {
async _final(callback) {
// eslint-disable-next-line no-restricted-syntax
await setTimeout(common.platformTimeout(1));
callback();
}
Expand Down