Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.eslintrc.js1
-rw-r--r--test/parallel/test-readable-from.js2
-rw-r--r--test/parallel/test-stream-compose.js2
-rw-r--r--test/parallel/test-stream-duplex-from.js2
-rw-r--r--test/parallel/test-stream-pipeline.js33
-rw-r--r--test/parallel/test-worker-message-port-terminate-transfer-list.js1
6 files changed, 21 insertions, 20 deletions
diff --git a/.eslintrc.js b/.eslintrc.js
index 76941cd1a6a..3231e3dff3f 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -320,6 +320,7 @@ module.exports = {
'quotes': ['error', 'single', { avoidEscape: true }],
'quote-props': ['error', 'consistent'],
'rest-spread-spacing': 'error',
+ 'require-yield': 'error',
'semi': 'error',
'semi-spacing': 'error',
'space-before-blocks': ['error', 'always'],
diff --git a/test/parallel/test-readable-from.js b/test/parallel/test-readable-from.js
index 24dee0dce20..b844574dc9e 100644
--- a/test/parallel/test-readable-from.js
+++ b/test/parallel/test-readable-from.js
@@ -126,7 +126,7 @@ async function toReadableOnDataNonObject() {
}
async function destroysTheStreamWhenThrowing() {
- async function* generate() {
+ async function* generate() { // eslint-disable-line require-yield
throw new Error('kaboom');
}
diff --git a/test/parallel/test-stream-compose.js b/test/parallel/test-stream-compose.js
index c3d52e08e00..3b336a8c1c7 100644
--- a/test/parallel/test-stream-compose.js
+++ b/test/parallel/test-stream-compose.js
@@ -234,7 +234,7 @@ const assert = require('assert');
callback(null, chunk);
})
}),
- async function*(source) {
+ async function*(source) { // eslint-disable-line require-yield
let tmp = '';
for await (const chunk of source) {
tmp += chunk;
diff --git a/test/parallel/test-stream-duplex-from.js b/test/parallel/test-stream-duplex-from.js
index 446768d6eef..6c9c59a5c82 100644
--- a/test/parallel/test-stream-duplex-from.js
+++ b/test/parallel/test-stream-duplex-from.js
@@ -134,7 +134,7 @@ const { Duplex, Readable, Writable, pipeline } = require('stream');
}
yield rest;
}),
- async function * (source) {
+ async function * (source) { // eslint-disable-line require-yield
let ret = '';
for await (const x of source) {
ret += x;
diff --git a/test/parallel/test-stream-pipeline.js b/test/parallel/test-stream-pipeline.js
index bf1cb84ecda..192f971b29d 100644
--- a/test/parallel/test-stream-pipeline.js
+++ b/test/parallel/test-stream-pipeline.js
@@ -699,8 +699,8 @@ const tsp = require('timers/promises');
const ret = pipeline(async function*() {
await Promise.resolve();
yield 'hello';
- }, async function*(source) {
- for await (const chunk of source) {}
+ }, async function*(source) { // eslint-disable-line require-yield
+ for await (const chunk of source) {} // eslint-disable-line no-unused-vars
}, common.mustCall((err) => {
assert.strictEqual(err, undefined);
}));
@@ -712,11 +712,11 @@ const tsp = require('timers/promises');
// AsyncFunction destination is not returned and error is
// propagated.
- const ret = pipeline(async function*() {
+ const ret = pipeline(async function*() { // eslint-disable-line require-yield
await Promise.resolve();
throw new Error('kaboom');
- }, async function*(source) {
- for await (const chunk of source) {}
+ }, async function*(source) { // eslint-disable-line require-yield
+ for await (const chunk of source) {} // eslint-disable-line no-unused-vars
}, common.mustCall((err) => {
assert.strictEqual(err.message, 'kaboom');
}));
@@ -726,7 +726,7 @@ const tsp = require('timers/promises');
{
const s = new PassThrough();
- pipeline(async function*() {
+ pipeline(async function*() { // eslint-disable-line require-yield
throw new Error('kaboom');
}, s, common.mustCall((err) => {
assert.strictEqual(err.message, 'kaboom');
@@ -736,7 +736,7 @@ const tsp = require('timers/promises');
{
const s = new PassThrough();
- pipeline(async function*() {
+ pipeline(async function*() { // eslint-disable-line require-yield
throw new Error('kaboom');
}(), s, common.mustCall((err) => {
assert.strictEqual(err.message, 'kaboom');
@@ -746,7 +746,7 @@ const tsp = require('timers/promises');
{
const s = new PassThrough();
- pipeline(function*() {
+ pipeline(function*() { // eslint-disable-line require-yield
throw new Error('kaboom');
}, s, common.mustCall((err, val) => {
assert.strictEqual(err.message, 'kaboom');
@@ -756,7 +756,7 @@ const tsp = require('timers/promises');
{
const s = new PassThrough();
- pipeline(function*() {
+ pipeline(function*() { // eslint-disable-line require-yield
throw new Error('kaboom');
}(), s, common.mustCall((err, val) => {
assert.strictEqual(err.message, 'kaboom');
@@ -771,7 +771,7 @@ const tsp = require('timers/promises');
yield 'hello';
yield 'world';
}, s, async function(source) {
- for await (const chunk of source) {
+ for await (const chunk of source) { // eslint-disable-line no-unused-vars
throw new Error('kaboom');
}
}, common.mustCall((err, val) => {
@@ -784,8 +784,8 @@ const tsp = require('timers/promises');
const s = new PassThrough();
const ret = pipeline(function() {
return ['hello', 'world'];
- }, s, async function*(source) {
- for await (const chunk of source) {
+ }, s, async function*(source) { // eslint-disable-line require-yield
+ for await (const chunk of source) { // eslint-disable-line no-unused-vars
throw new Error('kaboom');
}
}, common.mustCall((err) => {
@@ -1054,12 +1054,11 @@ const tsp = require('timers/promises');
const ws = new Writable({
write: common.mustNotCall()
});
- pipeline(rs, async function*(stream) {
- /* eslint no-unused-vars: off */
- for await (const chunk of stream) {
+ pipeline(rs, async function*(stream) { // eslint-disable-line require-yield
+ for await (const chunk of stream) { // eslint-disable-line no-unused-vars
throw new Error('kaboom');
}
- }, async function *(source) {
+ }, async function *(source) { // eslint-disable-line require-yield
for await (const chunk of source) {
res += chunk;
}
@@ -1394,7 +1393,7 @@ const tsp = require('timers/promises');
const ac = new AbortController();
const signal = ac.signal;
pipelinep(
- async function * ({ signal }) {
+ async function * ({ signal }) { // eslint-disable-line require-yield
await tsp.setTimeout(1e6, signal);
},
async function(source) {
diff --git a/test/parallel/test-worker-message-port-terminate-transfer-list.js b/test/parallel/test-worker-message-port-terminate-transfer-list.js
index a066405d9d1..a5c7a34c55e 100644
--- a/test/parallel/test-worker-message-port-terminate-transfer-list.js
+++ b/test/parallel/test-worker-message-port-terminate-transfer-list.js
@@ -18,6 +18,7 @@ if (!process.env.HAS_STARTED_WORKER) {
// Make sure we don’t end up running JS after the infinite loop is broken.
port1.postMessage({}, {
+ // eslint-disable-next-line require-yield
transfer: (function*() { while (true); })()
});