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

debugger: reduce scope of eslint disable comment #38946

Merged
merged 1 commit into from
Jun 8, 2021
Merged
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
15 changes: 6 additions & 9 deletions lib/internal/inspector/_inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
* IN THE SOFTWARE.
*/

// TODO(aduh95): remove restricted syntax errors
/* eslint-disable no-restricted-syntax */

'use strict';

const {
Expand Down Expand Up @@ -53,8 +50,8 @@ const { EventEmitter } = require('events');
const net = require('net');
const util = require('util');
const {
setInterval,
setTimeout,
setInterval: pSetInterval,
setTimeout: pSetTimeout,
} = require('timers/promises');
const {
AbortController,
Expand Down Expand Up @@ -85,13 +82,13 @@ async function portIsFree(host, port, timeout = 9999) {
const ac = new AbortController();
const { signal } = ac;

setTimeout(timeout).then(() => ac.abort());
pSetTimeout(timeout).then(() => ac.abort());

const asyncIterator = setInterval(retryDelay);
const asyncIterator = pSetInterval(retryDelay);
while (true) {
await asyncIterator.next();
if (signal.aborted) {
throw new StartupError(
throw new StartupError( // eslint-disable-line no-restricted-syntax
`Timeout (${timeout}) waiting for ${host}:${port} to be free`);
}
const error = await new Promise((resolve) => {
Expand Down Expand Up @@ -251,7 +248,7 @@ class NodeInspector {
return;
} catch (error) {
debuglog('connect failed', error);
await setTimeout(1000);
await pSetTimeout(1000);
}
}
this.stdout.write(' failed to connect, please retry\n');
Expand Down