Skip to content

Commit d56e826

Browse files
Trotttargos
authored andcommitted
doc,lib: prepare for stricter multi-line array linting
We're about to turn on a requirement for dangling commas. PR-URL: #37088 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 9db3304 commit d56e826

28 files changed

+48
-48
lines changed

doc/api/child_process.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,7 +1326,7 @@ const subprocess = spawn(
13261326
'-c',
13271327
`node -e "setInterval(() => {
13281328
console.log(process.pid, 'is alive')
1329-
}, 500);"`
1329+
}, 500);"`,
13301330
], {
13311331
stdio: ['inherit', 'inherit', 'inherit']
13321332
}
@@ -1661,7 +1661,7 @@ const subprocess = child_process.spawn('ls', {
16611661
stdio: [
16621662
0, // Use parent's stdin for child.
16631663
'pipe', // Pipe child's stdout to parent.
1664-
fs.openSync('err.out', 'w') // Direct child's stderr to a file.
1664+
fs.openSync('err.out', 'w'), // Direct child's stderr to a file.
16651665
]
16661666
});
16671667

doc/api/dns.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ section if a custom port is used.
160160
'4.4.4.4',
161161
'2001:4860:4860::8888',
162162
'4.4.4.4:1053',
163-
'[2001:4860:4860::8888]:1053'
163+
'[2001:4860:4860::8888]:1053',
164164
]
165165
```
166166

@@ -666,7 +666,7 @@ dns.setServers([
666666
'4.4.4.4',
667667
'[2001:4860:4860::8888]',
668668
'4.4.4.4:1053',
669-
'[2001:4860:4860::8888]:1053'
669+
'[2001:4860:4860::8888]:1053',
670670
]);
671671
```
672672

@@ -773,7 +773,7 @@ section if a custom port is used.
773773
'4.4.4.4',
774774
'2001:4860:4860::8888',
775775
'4.4.4.4:1053',
776-
'[2001:4860:4860::8888]:1053'
776+
'[2001:4860:4860::8888]:1053',
777777
]
778778
```
779779

@@ -1184,7 +1184,7 @@ dnsPromises.setServers([
11841184
'4.4.4.4',
11851185
'[2001:4860:4860::8888]',
11861186
'4.4.4.4:1053',
1187-
'[2001:4860:4860::8888]:1053'
1187+
'[2001:4860:4860::8888]:1053',
11881188
]);
11891189
```
11901190

doc/api/os.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ The properties included on each object include:
115115
idle: 1070905480,
116116
irq: 20
117117
}
118-
}
118+
},
119119
]
120120
```
121121

doc/api/url.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ with [`JSON.stringify()`][].
573573
```js
574574
const myURLs = [
575575
new URL('https://www.example.com'),
576-
new URL('https://test.example.org')
576+
new URL('https://test.example.org'),
577577
];
578578
console.log(JSON.stringify(myURLs));
579579
// Prints ["https://www.example.com/","https://test.example.org/"]
@@ -710,7 +710,7 @@ let params;
710710
params = new URLSearchParams([
711711
['user', 'abc'],
712712
['query', 'first'],
713-
['query', 'second']
713+
['query', 'second'],
714714
]);
715715
console.log(params.toString());
716716
// Prints 'user=abc&query=first&query=second'
@@ -735,7 +735,7 @@ console.log(params.toString());
735735

736736
// Each key-value pair must have exactly two elements
737737
new URLSearchParams([
738-
['user', 'abc', 'error']
738+
['user', 'abc', 'error'],
739739
]);
740740
// Throws TypeError [ERR_INVALID_TUPLE]:
741741
// Each query pair must be an iterable [name, value] tuple

lib/assert.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const meta = [
9191
'\\u000f', '\\u0010', '\\u0011', '\\u0012', '\\u0013',
9292
'\\u0014', '\\u0015', '\\u0016', '\\u0017', '\\u0018',
9393
'\\u0019', '\\u001a', '\\u001b', '\\u001c', '\\u001d',
94-
'\\u001e', '\\u001f'
94+
'\\u001e', '\\u001f',
9595
];
9696

9797
const escapeFn = (str) => meta[StringPrototypeCharCodeAt(str, 0)];
@@ -268,7 +268,7 @@ function parseCode(code, offset) {
268268
node.node.start,
269269
StringPrototypeReplace(StringPrototypeSlice(code,
270270
node.node.start, node.node.end),
271-
escapeSequencesRegExp, escapeFn)
271+
escapeSequencesRegExp, escapeFn),
272272
];
273273
}
274274

lib/internal/bootstrap/loaders.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const internalBindingAllowlist = new SafeSet([
103103
'util',
104104
'uv',
105105
'v8',
106-
'zlib'
106+
'zlib',
107107
]);
108108

109109
// Set up process.binding() and process._linkedBinding().

lib/internal/bootstrap/pre_execution.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ function initializeDeprecations() {
252252
'isSetIterator',
253253
'isTypedArray',
254254
'isUint8Array',
255-
'isAnyArrayBuffer'
255+
'isAnyArrayBuffer',
256256
]) {
257257
utilBinding[name] = pendingDeprecation ?
258258
deprecate(types[name],

lib/internal/console/constructor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ const consoleMethods = {
532532
}
533533
}
534534
return final([
535-
iterKey, keyKey, valuesKey
535+
iterKey, keyKey, valuesKey,
536536
], [
537537
getIndexArray(length),
538538
keys,

lib/internal/crypto/random.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ function handleError(ex, buf) {
223223

224224
const kHexDigits = [
225225
48, 49, 50, 51, 52, 53, 54, 55,
226-
56, 57, 97, 98, 99, 100, 101, 102
226+
56, 57, 97, 98, 99, 100, 101, 102,
227227
];
228228

229229
const kBatchSize = 128;

lib/internal/encoding.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ const encodings = new SafeMap([
286286
['windows-949', 'euc-kr'],
287287
['utf-16be', 'utf-16be'],
288288
['utf-16le', 'utf-16le'],
289-
['utf-16', 'utf-16le']
289+
['utf-16', 'utf-16le'],
290290
]);
291291

292292
// Unfortunately, String.prototype.trim also removes non-ascii whitespace,

0 commit comments

Comments
 (0)