Skip to content

Commit 9c69ca5

Browse files
Trotttargos
authored andcommitted
test,doc,lib: adjust object literal newlines for lint rule
Before enabling object-curly-newline for our ESLint rules, adjust files to comply with it. Refs: https://eslint.org/docs/rules/object-curly-newline PR-URL: #37040 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 110063d commit 9c69ca5

33 files changed

+159
-181
lines changed

doc/api/http2.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3675,7 +3675,8 @@ will be emitted.
36753675
const body = 'hello world';
36763676
response.writeHead(200, {
36773677
'Content-Length': Buffer.byteLength(body),
3678-
'Content-Type': 'text/plain; charset=utf-8' });
3678+
'Content-Type': 'text/plain; charset=utf-8',
3679+
});
36793680
```
36803681

36813682
`Content-Length` is given in bytes not characters. The

lib/internal/async_hooks.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,10 @@ const { resource_symbol, owner_symbol } = internalBinding('symbols');
9191
// Each constant tracks how many callbacks there are for any given step of
9292
// async execution. These are tracked so if the user didn't include callbacks
9393
// for a given step, that step can bail out early.
94-
const { kInit, kBefore, kAfter, kDestroy, kTotals, kPromiseResolve,
95-
kCheck, kExecutionAsyncId, kAsyncIdCounter, kTriggerAsyncId,
96-
kDefaultTriggerAsyncId, kStackLength, kUsesExecutionAsyncResource
94+
const {
95+
kInit, kBefore, kAfter, kDestroy, kTotals, kPromiseResolve,
96+
kCheck, kExecutionAsyncId, kAsyncIdCounter, kTriggerAsyncId,
97+
kDefaultTriggerAsyncId, kStackLength, kUsesExecutionAsyncResource,
9798
} = async_wrap.constants;
9899

99100
const { async_id_symbol,

lib/internal/encoding.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,8 @@ ObjectDefineProperties(
363363
'encode': { enumerable: true },
364364
'encodeInto': { enumerable: true },
365365
'encoding': { enumerable: true },
366-
[SymbolToStringTag]: {
367-
configurable: true,
368-
value: 'TextEncoder'
369-
} });
366+
[SymbolToStringTag]: { configurable: true, value: 'TextEncoder' },
367+
});
370368

371369
const TextDecoder =
372370
internalBinding('config').hasIntl ?

lib/internal/http2/core.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,10 @@ const {
126126
} = require('internal/validators');
127127
const fsPromisesInternal = require('internal/fs/promises');
128128
const { utcDate } = require('internal/http');
129-
const { onServerStream,
130-
Http2ServerRequest,
131-
Http2ServerResponse,
129+
const {
130+
Http2ServerRequest,
131+
Http2ServerResponse,
132+
onServerStream,
132133
} = require('internal/http2/compat');
133134

134135
const {

test/doctool/test-doctool-json.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ const testData = [
121121
{ 'version': 'v4.2.0',
122122
'pr-url': 'https://github.com/nodejs/node/pull/3276',
123123
'description': 'The `error` parameter can now be ' +
124-
'an arrow function.'
125-
}
124+
'an arrow function.' }
126125
]
127126
},
128127
desc: '<p>Describe <code>Foobar II</code> in more detail ' +

test/node-api/test_threadsafe_function/test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ function testWithJSMarshaller({
3636
quitAfter,
3737
abort,
3838
maxQueueSize,
39-
launchSecondary }) {
39+
launchSecondary,
40+
}) {
4041
return new Promise((resolve) => {
4142
const array = [];
4243
binding[threadStarter](function testCallback(value) {

test/parallel/test-dns.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -362,18 +362,15 @@ assert.throws(() => {
362362
expire: 1800,
363363
minttl: 3333333333
364364
},
365-
]
366-
},
365+
] },
367366

368367
{ method: 'resolve4',
369368
options: { ttl: true },
370-
answers: [ { type: 'A', address: '1.2.3.4', ttl: 3333333333 } ]
371-
},
369+
answers: [ { type: 'A', address: '1.2.3.4', ttl: 3333333333 } ] },
372370

373371
{ method: 'resolve6',
374372
options: { ttl: true },
375-
answers: [ { type: 'AAAA', address: '::42', ttl: 3333333333 } ]
376-
},
373+
answers: [ { type: 'AAAA', address: '::42', ttl: 3333333333 } ] },
377374

378375
{ method: 'resolveSoa',
379376
answers: [
@@ -387,8 +384,7 @@ assert.throws(() => {
387384
expire: 1800,
388385
minttl: 3333333333
389386
}
390-
]
391-
},
387+
] },
392388
];
393389

394390
const server = dgram.createSocket('udp4');

test/parallel/test-fs-open-flags.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ const { O_APPEND = 0,
3838
O_SYNC = 0,
3939
O_DSYNC = 0,
4040
O_TRUNC = 0,
41-
O_WRONLY = 0
42-
} = fs.constants;
41+
O_WRONLY = 0 } = fs.constants;
4342

4443
const { stringToFlags } = require('internal/fs/utils');
4544

test/parallel/test-fs-readfile.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,15 @@ tmpdir.refresh();
1515

1616
const fileInfo = [
1717
{ name: path.join(tmpdir.path, `${prefix}-1K.txt`),
18-
len: 1024,
19-
},
18+
len: 1024 },
2019
{ name: path.join(tmpdir.path, `${prefix}-64K.txt`),
21-
len: 64 * 1024,
22-
},
20+
len: 64 * 1024 },
2321
{ name: path.join(tmpdir.path, `${prefix}-64KLessOne.txt`),
24-
len: (64 * 1024) - 1,
25-
},
22+
len: (64 * 1024) - 1 },
2623
{ name: path.join(tmpdir.path, `${prefix}-1M.txt`),
27-
len: 1 * 1024 * 1024,
28-
},
24+
len: 1 * 1024 * 1024 },
2925
{ name: path.join(tmpdir.path, `${prefix}-1MPlusOne.txt`),
30-
len: (1 * 1024 * 1024) + 1,
31-
},
26+
len: (1 * 1024 * 1024) + 1 },
3227
];
3328

3429
// Populate each fileInfo (and file) with unique fill.

test/parallel/test-http2-max-settings.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ server.listen(0, common.mustCall(() => {
2727
// The actual settings values do not matter.
2828
headerTableSize: 1000,
2929
enablePush: false,
30-
} });
30+
},
31+
});
3132

3233
client.on('error', common.mustCall(() => {
3334
server.close();

0 commit comments

Comments
 (0)