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

lib: do not disable linter for entire files #48299

Merged
merged 1 commit into from
Jun 2, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions lib/internal/http2/core.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict';

/* eslint-disable no-use-before-define */

const {
ArrayFrom,
ArrayIsArray,
Expand Down Expand Up @@ -363,6 +361,7 @@ function onSessionHeaders(handle, id, cat, flags, headers, sensitiveHeaders) {
}
// session[kType] can be only one of two possible values
if (type === NGHTTP2_SESSION_SERVER) {
// eslint-disable-next-line no-use-before-define
stream = new ServerHttp2Stream(session, handle, id, {}, obj);
if (endOfStream) {
stream.push(null);
Expand All @@ -374,6 +373,7 @@ function onSessionHeaders(handle, id, cat, flags, headers, sensitiveHeaders) {
stream[kState].flags |= STREAM_FLAGS_HEAD_REQUEST;
}
} else {
// eslint-disable-next-line no-use-before-define
stream = new ClientHttp2Stream(session, handle, id, {});
if (endOfStream) {
stream.push(null);
Expand Down Expand Up @@ -1788,6 +1788,7 @@ class ClientHttp2Session extends Http2Session {

const headersList = mapToHeaders(headers);

// eslint-disable-next-line no-use-before-define
const stream = new ClientHttp2Stream(this, undefined, undefined, {});
stream[kSentHeaders] = headers;
stream[kOrigin] = `${headers[HTTP2_HEADER_SCHEME]}://` +
Expand Down Expand Up @@ -3412,5 +3413,3 @@ module.exports = {
Http2ServerRequest,
Http2ServerResponse,
};

/* eslint-enable no-use-before-define */
8 changes: 4 additions & 4 deletions lib/internal/webstreams/readablestream.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict';

/* eslint-disable no-use-before-define */

const {
ArrayBuffer,
ArrayBufferPrototypeGetByteLength,
Expand Down Expand Up @@ -343,10 +341,12 @@ class ReadableStream {
const mode = options?.mode;

if (mode === undefined)
// eslint-disable-next-line no-use-before-define
return new ReadableStreamDefaultReader(this);

if (`${mode}` !== 'byob')
throw new ERR_INVALID_ARG_VALUE('options.mode', mode);
// eslint-disable-next-line no-use-before-define
return new ReadableStreamBYOBReader(this);
}

Expand Down Expand Up @@ -466,6 +466,7 @@ class ReadableStream {
preventCancel = false,
} = options;

// eslint-disable-next-line no-use-before-define
const reader = new ReadableStreamDefaultReader(this);
let done = false;
let started = false;
Expand Down Expand Up @@ -576,6 +577,7 @@ class ReadableStream {
locked: this.locked,
state: this[kState].state,
supportsBYOB:
// eslint-disable-next-line no-use-before-define
this[kState].controller instanceof ReadableByteStreamController,
});
}
Expand Down Expand Up @@ -3259,5 +3261,3 @@ module.exports = {
setupReadableByteStreamController,
setupReadableByteStreamControllerFromSource,
};

/* eslint-enable no-use-before-define */
5 changes: 1 addition & 4 deletions lib/internal/webstreams/writablestream.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict';

/* eslint-disable no-use-before-define */

const {
ArrayPrototypePush,
ArrayPrototypeShift,
Expand Down Expand Up @@ -262,6 +260,7 @@ class WritableStream {
getWriter() {
if (!isWritableStream(this))
throw new ERR_INVALID_THIS('WritableStream');
// eslint-disable-next-line no-use-before-define
return new WritableStreamDefaultWriter(this);
}

Expand Down Expand Up @@ -1360,5 +1359,3 @@ module.exports = {
setupWritableStreamDefaultControllerFromSink,
setupWritableStreamDefaultController,
};

/* eslint-enable no-use-before-define */