Skip to content

Commit 294b3e6

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 2642657 commit 294b3e6

25 files changed

+72
-94
lines changed

doc/api/http2.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3640,7 +3640,8 @@ will be emitted.
36403640
const body = 'hello world';
36413641
response.writeHead(200, {
36423642
'Content-Length': Buffer.byteLength(body),
3643-
'Content-Type': 'text/plain; charset=utf-8' });
3643+
'Content-Type': 'text/plain; charset=utf-8',
3644+
});
36443645
```
36453646

36463647
`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
@@ -364,10 +364,8 @@ ObjectDefineProperties(
364364
'encode': { enumerable: true },
365365
'encodeInto': { enumerable: true },
366366
'encoding': { enumerable: true },
367-
[SymbolToStringTag]: {
368-
configurable: true,
369-
value: 'TextEncoder'
370-
} });
367+
[SymbolToStringTag]: { configurable: true, value: 'TextEncoder' },
368+
});
371369

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

lib/internal/http2/core.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,9 +108,10 @@ const {
108108
} = require('internal/validators');
109109
const fsPromisesInternal = require('internal/fs/promises');
110110
const { utcDate } = require('internal/http');
111-
const { onServerStream,
112-
Http2ServerRequest,
113-
Http2ServerResponse,
111+
const {
112+
Http2ServerRequest,
113+
Http2ServerResponse,
114+
onServerStream,
114115
} = require('internal/http2/compat');
115116

116117
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
@@ -16,20 +16,15 @@ tmpdir.refresh();
1616

1717
const fileInfo = [
1818
{ name: path.join(tmpdir.path, `${prefix}-1K.txt`),
19-
len: 1024,
20-
},
19+
len: 1024 },
2120
{ name: path.join(tmpdir.path, `${prefix}-64K.txt`),
22-
len: 64 * 1024,
23-
},
21+
len: 64 * 1024 },
2422
{ name: path.join(tmpdir.path, `${prefix}-64KLessOne.txt`),
25-
len: (64 * 1024) - 1,
26-
},
23+
len: (64 * 1024) - 1 },
2724
{ name: path.join(tmpdir.path, `${prefix}-1M.txt`),
28-
len: 1 * 1024 * 1024,
29-
},
25+
len: 1 * 1024 * 1024 },
3026
{ name: path.join(tmpdir.path, `${prefix}-1MPlusOne.txt`),
31-
len: (1 * 1024 * 1024) + 1,
32-
},
27+
len: (1 * 1024 * 1024) + 1 },
3328
];
3429

3530
// 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)