Skip to content

Commit 72de4e7

Browse files
aduh95targos
authored andcommitted
lib: do not disable linter for entire files
Disabling linter for single lines is less error prone. PR-URL: #48299 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Debadree Chatterjee <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Paolo Insogna <[email protected]>
1 parent a94f87e commit 72de4e7

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

‎lib/internal/http2/core.js‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
'use strict';
22

3-
/* eslint-disable no-use-before-define */
4-
53
const{
64
ArrayFrom,
75
ArrayIsArray,
@@ -363,6 +361,7 @@ function onSessionHeaders(handle, id, cat, flags, headers, sensitiveHeaders){
363361
}
364362
// session[kType] can be only one of two possible values
365363
if(type===NGHTTP2_SESSION_SERVER){
364+
// eslint-disable-next-line no-use-before-define
366365
stream=newServerHttp2Stream(session,handle,id,{},obj);
367366
if(endOfStream){
368367
stream.push(null);
@@ -374,6 +373,7 @@ function onSessionHeaders(handle, id, cat, flags, headers, sensitiveHeaders){
374373
stream[kState].flags|=STREAM_FLAGS_HEAD_REQUEST;
375374
}
376375
}else{
376+
// eslint-disable-next-line no-use-before-define
377377
stream=newClientHttp2Stream(session,handle,id,{});
378378
if(endOfStream){
379379
stream.push(null);
@@ -1788,6 +1788,7 @@ class ClientHttp2Session extends Http2Session{
17881788

17891789
constheadersList=mapToHeaders(headers);
17901790

1791+
// eslint-disable-next-line no-use-before-define
17911792
conststream=newClientHttp2Stream(this,undefined,undefined,{});
17921793
stream[kSentHeaders]=headers;
17931794
stream[kOrigin]=`${headers[HTTP2_HEADER_SCHEME]}://`+
@@ -3412,5 +3413,3 @@ module.exports ={
34123413
Http2ServerRequest,
34133414
Http2ServerResponse,
34143415
};
3415-
3416-
/* eslint-enable no-use-before-define */

‎lib/internal/webstreams/readablestream.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
'use strict';
22

3-
/* eslint-disable no-use-before-define */
4-
53
const{
64
ArrayBuffer,
75
ArrayBufferPrototypeGetByteLength,
@@ -343,10 +341,12 @@ class ReadableStream{
343341
constmode=options?.mode;
344342

345343
if(mode===undefined)
344+
// eslint-disable-next-line no-use-before-define
346345
returnnewReadableStreamDefaultReader(this);
347346

348347
if(`${mode}`!=='byob')
349348
thrownewERR_INVALID_ARG_VALUE('options.mode',mode);
349+
// eslint-disable-next-line no-use-before-define
350350
returnnewReadableStreamBYOBReader(this);
351351
}
352352

@@ -466,6 +466,7 @@ class ReadableStream{
466466
preventCancel =false,
467467
}=options;
468468

469+
// eslint-disable-next-line no-use-before-define
469470
constreader=newReadableStreamDefaultReader(this);
470471
letdone=false;
471472
letstarted=false;
@@ -576,6 +577,7 @@ class ReadableStream{
576577
locked: this.locked,
577578
state: this[kState].state,
578579
supportsBYOB:
580+
// eslint-disable-next-line no-use-before-define
579581
this[kState].controllerinstanceofReadableByteStreamController,
580582
});
581583
}
@@ -3259,5 +3261,3 @@ module.exports ={
32593261
setupReadableByteStreamController,
32603262
setupReadableByteStreamControllerFromSource,
32613263
};
3262-
3263-
/* eslint-enable no-use-before-define */

‎lib/internal/webstreams/writablestream.js‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
'use strict';
22

3-
/* eslint-disable no-use-before-define */
4-
53
const{
64
ArrayPrototypePush,
75
ArrayPrototypeShift,
@@ -262,6 +260,7 @@ class WritableStream{
262260
getWriter(){
263261
if(!isWritableStream(this))
264262
thrownewERR_INVALID_THIS('WritableStream');
263+
// eslint-disable-next-line no-use-before-define
265264
returnnewWritableStreamDefaultWriter(this);
266265
}
267266

@@ -1360,5 +1359,3 @@ module.exports ={
13601359
setupWritableStreamDefaultControllerFromSink,
13611360
setupWritableStreamDefaultController,
13621361
};
1363-
1364-
/* eslint-enable no-use-before-define */

0 commit comments

Comments
(0)