Skip to content

Commit a4c2d41

Browse files
committed
tools: enable sort-requires rule
1 parent af1e2f0 commit a4c2d41

File tree

140 files changed

+468
-467
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+468
-467
lines changed

lib/.eslintrc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ rules:
166166
node-core/lowercase-name-for-primitive: error
167167
node-core/non-ascii-character: error
168168
node-core/no-array-destructuring: error
169+
node-core/sort-requires: error
169170
node-core/prefer-primordials:
170171
- error
171172
- name: AggregateError

lib/_http_client.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,31 +48,31 @@ const {
4848
once,
4949
} = require('internal/util');
5050
const {
51+
HTTPParser,
5152
_checkIsHttpToken: checkIsHttpToken,
5253
freeParser,
53-
parsers,
54-
HTTPParser,
5554
isLenient,
55+
parsers,
5656
prepareError,
5757
} = require('_http_common');
5858
const {
59+
OutgoingMessage,
5960
kUniqueHeaders,
60-
parseUniqueHeadersOption,
61-
OutgoingMessage
61+
parseUniqueHeadersOption
6262
} = require('_http_outgoing');
6363
const Agent = require('_http_agent');
6464
const { Buffer } = require('buffer');
6565
const { defaultTriggerAsyncIdScope } = require('internal/async_hooks');
66-
const { URL, urlToHttpOptions, searchParamsSymbol } = require('internal/url');
66+
const { URL, searchParamsSymbol, urlToHttpOptions } = require('internal/url');
6767
const {
68-
kOutHeaders,
69-
kNeedDrain,
68+
getNextTraceEventId,
7069
isTraceHTTPEnabled,
70+
kNeedDrain,
71+
kOutHeaders,
7172
traceBegin,
7273
traceEnd,
73-
getNextTraceEventId,
7474
} = require('internal/http');
75-
const { connResetException, codes } = require('internal/errors');
75+
const { codes, connResetException } = require('internal/errors');
7676
const {
7777
ERR_HTTP_HEADERS_SENT,
7878
ERR_INVALID_ARG_TYPE,

lib/_http_common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323

2424
const {
2525
MathMin,
26-
Symbol,
2726
RegExpPrototypeExec,
27+
Symbol,
2828
} = primordials;
2929
const { setImmediate } = require('timers');
3030

lib/_http_outgoing.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ const {
3030
ObjectCreate,
3131
ObjectDefineProperty,
3232
ObjectKeys,
33-
ObjectValues,
3433
ObjectPrototypeHasOwnProperty,
3534
ObjectSetPrototypeOf,
35+
ObjectValues,
3636
RegExpPrototypeExec,
3737
SafeSet,
3838
StringPrototypeToLowerCase,
@@ -44,12 +44,12 @@ const assert = require('internal/assert');
4444
const EE = require('events');
4545
const Stream = require('stream');
4646
const internalUtil = require('internal/util');
47-
const { kOutHeaders, utcDate, kNeedDrain } = require('internal/http');
47+
const { kNeedDrain, kOutHeaders, utcDate } = require('internal/http');
4848
const { Buffer } = require('buffer');
4949
const {
50-
_checkIsHttpToken: checkIsHttpToken,
51-
_checkInvalidHeaderChar: checkInvalidHeaderChar,
5250
chunkExpression: RE_TE_CHUNKED,
51+
_checkInvalidHeaderChar: checkInvalidHeaderChar,
52+
_checkIsHttpToken: checkIsHttpToken,
5353
} = require('_http_common');
5454
const {
5555
defaultTriggerAsyncIdScope,

lib/_http_server.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ const {
2626
Error,
2727
ObjectKeys,
2828
ObjectSetPrototypeOf,
29-
RegExpPrototypeExec,
3029
ReflectApply,
30+
RegExpPrototypeExec,
3131
Symbol,
3232
SymbolFor,
3333
} = primordials;
@@ -36,38 +36,38 @@ const net = require('net');
3636
const EE = require('events');
3737
const assert = require('internal/assert');
3838
const {
39-
parsers,
40-
freeParser,
41-
continueExpression,
42-
chunkExpression,
43-
kIncomingMessage,
4439
HTTPParser,
45-
isLenient,
4640
_checkInvalidHeaderChar: checkInvalidHeaderChar,
41+
chunkExpression,
42+
continueExpression,
43+
freeParser,
44+
isLenient,
45+
kIncomingMessage,
46+
parsers,
4747
prepareError,
4848
} = require('_http_common');
4949
const { ConnectionsList } = internalBinding('http_parser');
5050
const {
51+
OutgoingMessage,
5152
kUniqueHeaders,
52-
parseUniqueHeadersOption,
53-
OutgoingMessage
53+
parseUniqueHeadersOption
5454
} = require('_http_outgoing');
5555
const {
56-
kOutHeaders,
57-
kNeedDrain,
56+
getNextTraceEventId,
5857
isTraceHTTPEnabled,
58+
kNeedDrain,
59+
kOutHeaders,
5960
traceBegin,
6061
traceEnd,
61-
getNextTraceEventId,
6262
} = require('internal/http');
6363
const {
6464
defaultTriggerAsyncIdScope,
6565
getOrSetAsyncId
6666
} = require('internal/async_hooks');
6767
const { IncomingMessage } = require('_http_incoming');
6868
const {
69-
connResetException,
70-
codes
69+
codes,
70+
connResetException
7171
} = require('internal/errors');
7272
const {
7373
ERR_HTTP_REQUEST_TIMEOUT,
@@ -79,11 +79,11 @@ const {
7979
ERR_INVALID_CHAR
8080
} = codes;
8181
const {
82-
validateInteger,
83-
validateBoolean
82+
validateBoolean,
83+
validateInteger
8484
} = require('internal/validators');
8585
const Buffer = require('buffer').Buffer;
86-
const { setInterval, clearInterval } = require('timers');
86+
const { clearInterval, setInterval } = require('timers');
8787
let debug = require('internal/util/debuglog').debuglog('http', (fn) => {
8888
debug = fn;
8989
});

lib/_tls_wrap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const { Pipe, constants: PipeConstants } = internalBinding('pipe_wrap');
6565
const { owner_symbol } = require('internal/async_hooks').symbols;
6666
const { isArrayBufferView } = require('internal/util/types');
6767
const { SecureContext: NativeSecureContext } = internalBinding('crypto');
68-
const { connResetException, codes } = require('internal/errors');
68+
const { codes, connResetException } = require('internal/errors');
6969
const {
7070
ERR_INVALID_ARG_TYPE,
7171
ERR_INVALID_ARG_VALUE,
@@ -82,8 +82,8 @@ const {
8282
} = codes;
8383
const { onpskexchange: kOnPskExchange } = internalBinding('symbols');
8484
const {
85-
getOptionValue,
8685
getAllowUnauthorized,
86+
getOptionValue,
8787
} = require('internal/options');
8888
const {
8989
validateBoolean,

lib/assert.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const {
6161
overrideStackTrace,
6262
} = require('internal/errors');
6363
const AssertionError = require('internal/assert/assertion_error');
64-
const { openSync, closeSync, readSync } = require('fs');
64+
const { closeSync, openSync, readSync } = require('fs');
6565
const { inspect } = require('internal/util/inspect');
6666
const { isPromise, isRegExp } = require('internal/util/types');
6767
const { EOL } = require('internal/constants');

lib/async_hooks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ const {
99
FunctionPrototypeBind,
1010
NumberIsSafeInteger,
1111
ObjectDefineProperties,
12+
ObjectFreeze,
1213
ObjectIs,
1314
ReflectApply,
1415
Symbol,
15-
ObjectFreeze,
1616
} = primordials;
1717

1818
const {

lib/buffer.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ const {
4444
StringPrototypeTrim,
4545
SymbolSpecies,
4646
SymbolToPrimitive,
47-
TypedArrayPrototypeGetByteLength,
4847
TypedArrayPrototypeFill,
48+
TypedArrayPrototypeGetByteLength,
4949
TypedArrayPrototypeSet,
5050
Uint8Array,
5151
Uint8ArrayPrototype,
@@ -76,9 +76,9 @@ const {
7676
const {
7777
customInspectSymbol,
7878
isInsideNodeModules,
79+
kIsEncodingSymbol,
7980
lazyDOMException,
80-
normalizeEncoding,
81-
kIsEncodingSymbol
81+
normalizeEncoding
8282
} = require('internal/util');
8383
const {
8484
isAnyArrayBuffer,
@@ -106,8 +106,8 @@ const {
106106
const {
107107
validateArray,
108108
validateBuffer,
109-
validateNumber,
110109
validateInteger,
110+
validateNumber,
111111
validateString
112112
} = require('internal/validators');
113113
// Provide validateInteger() but with kMaxLength as the default maximum value.
@@ -116,9 +116,9 @@ const validateOffset = (value, name, min = 0, max = kMaxLength) =>
116116

117117
const {
118118
FastBuffer,
119-
markAsUntransferable,
120119
addBufferPrototypeMethods,
121-
createUnsafeBuffer
120+
createUnsafeBuffer,
121+
markAsUntransferable
122122
} = require('internal/buffer');
123123

124124
const {

lib/child_process.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ const {
2828
ArrayPrototypeJoin,
2929
ArrayPrototypeLastIndexOf,
3030
ArrayPrototypePush,
31+
ArrayPrototypePushApply,
3132
ArrayPrototypeSlice,
3233
ArrayPrototypeSort,
3334
ArrayPrototypeSplice,
3435
ArrayPrototypeUnshift,
35-
ArrayPrototypePushApply,
3636
NumberIsInteger,
3737
ObjectAssign,
3838
ObjectDefineProperty,

0 commit comments

Comments
 (0)