lib: do not disable linter for entire files

Disabling linter for single lines is less error prone.

PR-URL: https://github.com/nodejs/node/pull/48299
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Paolo Insogna <paolo@cowtech.it>
This commit is contained in:
Antoine du Hamel authored and Michaël Zasso committed 2023-06-04 14:31:31 +02:00
1 parent a94f87ed99
commit 72de4e7170
3 files changed
+8 -12

No files matched your search

+3 -4
View File
@@ -1,7 +1,5 @@
'use strict';
/* eslint-disable no-use-before-define */
const {
ArrayFrom,
ArrayIsArray,
@@ -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);
@@ -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);
@@ -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]}://` +
@@ -3412,5 +3413,3 @@ module.exports = {
Http2ServerRequest,
Http2ServerResponse,
};
/* eslint-enable no-use-before-define */
+4 -4
View File
@@ -1,7 +1,5 @@
'use strict';
/* eslint-disable no-use-before-define */
const {
ArrayBuffer,
ArrayBufferPrototypeGetByteLength,
@@ -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);
}
@@ -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;
@@ -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,
});
}
@@ -3259,5 +3261,3 @@ module.exports = {
setupReadableByteStreamController,
setupReadableByteStreamControllerFromSource,
};
/* eslint-enable no-use-before-define */
+1 -4
View File
@@ -1,7 +1,5 @@
'use strict';
/* eslint-disable no-use-before-define */
const {
ArrayPrototypePush,
ArrayPrototypeShift,
@@ -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);
}
@@ -1360,5 +1359,3 @@ module.exports = {
setupWritableStreamDefaultControllerFromSink,
setupWritableStreamDefaultController,
};
/* eslint-enable no-use-before-define */