| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8090ce7 commit 1f4369a
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -320,6 +320,7 @@ module.exports = { | |||
| 320 | 320 | 'quotes': ['error', 'single', { avoidEscape: true }], | |
| 321 | 321 | 'quote-props': ['error', 'consistent'], | |
| 322 | 322 | 'rest-spread-spacing': 'error', | |
| 323 | + 'require-yield': 'error', | ||
| 323 | 324 | 'semi': 'error', | |
| 324 | 325 | 'semi-spacing': 'error', | |
| 325 | 326 | 'space-before-blocks': ['error', 'always'], | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -126,7 +126,7 @@ async function toReadableOnDataNonObject() { | |||
| 126 | 126 | } | |
| 127 | 127 | ||
| 128 | 128 | async function destroysTheStreamWhenThrowing() { | |
| 129 | - async function* generate() { | ||
| 129 | + async function* generate() { // eslint-disable-line require-yield | ||
| 130 | 130 | throw new Error('kaboom'); | |
| 131 | 131 | } | |
| 132 | 132 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -234,7 +234,7 @@ const assert = require('assert'); | |||
| 234 | 234 | callback(null, chunk); | |
| 235 | 235 | }) | |
| 236 | 236 | }), | |
| 237 | - async function*(source) { | ||
| 237 | + async function*(source) { // eslint-disable-line require-yield | ||
| 238 | 238 | let tmp = ''; | |
| 239 | 239 | for await (const chunk of source) { | |
| 240 | 240 | tmp += chunk; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -134,7 +134,7 @@ const { Duplex, Readable, Writable, pipeline } = require('stream'); | |||
| 134 | 134 | } | |
| 135 | 135 | yield rest; | |
| 136 | 136 | }), | |
| 137 | - async function * (source) { | ||
| 137 | + async function * (source) { // eslint-disable-line require-yield | ||
| 138 | 138 | let ret = ''; | |
| 139 | 139 | for await (const x of source) { | |
| 140 | 140 | ret += x; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -699,8 +699,8 @@ const tsp = require('timers/promises'); | |||
| 699 | 699 | const ret = pipeline(async function*() { | |
| 700 | 700 | await Promise.resolve(); | |
| 701 | 701 | yield 'hello'; | |
| 702 | - }, async function*(source) { | ||
| 703 | - for await (const chunk of source) {} | ||
| 702 | + }, async function*(source) { // eslint-disable-line require-yield | ||
| 703 | + for await (const chunk of source) {} // eslint-disable-line no-unused-vars | ||
| 704 | 704 | }, common.mustCall((err) => { | |
| 705 | 705 | assert.strictEqual(err, undefined); | |
| 706 | 706 | })); | |
@@ -712,11 +712,11 @@ const tsp = require('timers/promises'); | |||
| 712 | 712 | // AsyncFunction destination is not returned and error is | |
| 713 | 713 | // propagated. | |
| 714 | 714 | ||
| 715 | - const ret = pipeline(async function*() { | ||
| 715 | + const ret = pipeline(async function*() { // eslint-disable-line require-yield | ||
| 716 | 716 | await Promise.resolve(); | |
| 717 | 717 | throw new Error('kaboom'); | |
| 718 | - }, async function*(source) { | ||
| 719 | - for await (const chunk of source) {} | ||
| 718 | + }, async function*(source) { // eslint-disable-line require-yield | ||
| 719 | + for await (const chunk of source) {} // eslint-disable-line no-unused-vars | ||
| 720 | 720 | }, common.mustCall((err) => { | |
| 721 | 721 | assert.strictEqual(err.message, 'kaboom'); | |
| 722 | 722 | })); | |
@@ -726,7 +726,7 @@ const tsp = require('timers/promises'); | |||
| 726 | 726 | ||
| 727 | 727 | { | |
| 728 | 728 | const s = new PassThrough(); | |
| 729 | - pipeline(async function*() { | ||
| 729 | + pipeline(async function*() { // eslint-disable-line require-yield | ||
| 730 | 730 | throw new Error('kaboom'); | |
| 731 | 731 | }, s, common.mustCall((err) => { | |
| 732 | 732 | assert.strictEqual(err.message, 'kaboom'); | |
@@ -736,7 +736,7 @@ const tsp = require('timers/promises'); | |||
| 736 | 736 | ||
| 737 | 737 | { | |
| 738 | 738 | const s = new PassThrough(); | |
| 739 | - pipeline(async function*() { | ||
| 739 | + pipeline(async function*() { // eslint-disable-line require-yield | ||
| 740 | 740 | throw new Error('kaboom'); | |
| 741 | 741 | }(), s, common.mustCall((err) => { | |
| 742 | 742 | assert.strictEqual(err.message, 'kaboom'); | |
@@ -746,7 +746,7 @@ const tsp = require('timers/promises'); | |||
| 746 | 746 | ||
| 747 | 747 | { | |
| 748 | 748 | const s = new PassThrough(); | |
| 749 | - pipeline(function*() { | ||
| 749 | + pipeline(function*() { // eslint-disable-line require-yield | ||
| 750 | 750 | throw new Error('kaboom'); | |
| 751 | 751 | }, s, common.mustCall((err, val) => { | |
| 752 | 752 | assert.strictEqual(err.message, 'kaboom'); | |
@@ -756,7 +756,7 @@ const tsp = require('timers/promises'); | |||
| 756 | 756 | ||
| 757 | 757 | { | |
| 758 | 758 | const s = new PassThrough(); | |
| 759 | - pipeline(function*() { | ||
| 759 | + pipeline(function*() { // eslint-disable-line require-yield | ||
| 760 | 760 | throw new Error('kaboom'); | |
| 761 | 761 | }(), s, common.mustCall((err, val) => { | |
| 762 | 762 | assert.strictEqual(err.message, 'kaboom'); | |
@@ -771,7 +771,7 @@ const tsp = require('timers/promises'); | |||
| 771 | 771 | yield 'hello'; | |
| 772 | 772 | yield 'world'; | |
| 773 | 773 | }, s, async function(source) { | |
| 774 | - for await (const chunk of source) { | ||
| 774 | + for await (const chunk of source) { // eslint-disable-line no-unused-vars | ||
| 775 | 775 | throw new Error('kaboom'); | |
| 776 | 776 | } | |
| 777 | 777 | }, common.mustCall((err, val) => { | |
@@ -784,8 +784,8 @@ const tsp = require('timers/promises'); | |||
| 784 | 784 | const s = new PassThrough(); | |
| 785 | 785 | const ret = pipeline(function() { | |
| 786 | 786 | return ['hello', 'world']; | |
| 787 | - }, s, async function*(source) { | ||
| 788 | - for await (const chunk of source) { | ||
| 787 | + }, s, async function*(source) { // eslint-disable-line require-yield | ||
| 788 | + for await (const chunk of source) { // eslint-disable-line no-unused-vars | ||
| 789 | 789 | throw new Error('kaboom'); | |
| 790 | 790 | } | |
| 791 | 791 | }, common.mustCall((err) => { | |
@@ -1054,12 +1054,11 @@ const tsp = require('timers/promises'); | |||
| 1054 | 1054 | const ws = new Writable({ | |
| 1055 | 1055 | write: common.mustNotCall() | |
| 1056 | 1056 | }); | |
| 1057 | - pipeline(rs, async function*(stream) { | ||
| 1058 | - /* eslint no-unused-vars: off */ | ||
| 1059 | - for await (const chunk of stream) { | ||
| 1057 | + pipeline(rs, async function*(stream) { // eslint-disable-line require-yield | ||
| 1058 | + for await (const chunk of stream) { // eslint-disable-line no-unused-vars | ||
| 1060 | 1059 | throw new Error('kaboom'); | |
| 1061 | 1060 | } | |
| 1062 | - }, async function *(source) { | ||
| 1061 | + }, async function *(source) { // eslint-disable-line require-yield | ||
| 1063 | 1062 | for await (const chunk of source) { | |
| 1064 | 1063 | res += chunk; | |
| 1065 | 1064 | } | |
@@ -1394,7 +1393,7 @@ const tsp = require('timers/promises'); | |||
| 1394 | 1393 | const ac = new AbortController(); | |
| 1395 | 1394 | const signal = ac.signal; | |
| 1396 | 1395 | pipelinep( | |
| 1397 | - async function * ({ signal }) { | ||
| 1396 | + async function * ({ signal }) { // eslint-disable-line require-yield | ||
| 1398 | 1397 | await tsp.setTimeout(1e6, signal); | |
| 1399 | 1398 | }, | |
| 1400 | 1399 | async function(source) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,6 +18,7 @@ if (!process.env.HAS_STARTED_WORKER) { | |||
| 18 | 18 | ||
| 19 | 19 | // Make sure we don’t end up running JS after the infinite loop is broken. | |
| 20 | 20 | port1.postMessage({}, { | |
| 21 | + // eslint-disable-next-line require-yield | ||
| 21 | 22 | transfer: (function*() { while (true); })() | |
| 22 | 23 | }); | |
| 23 | 24 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments