Skip to content

Commit 49aef0d

Browse files
authored
doc: remove unnecessary <!-- eslint- magic comments
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #63200 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
1 parent ccab9ac commit 49aef0d

20 files changed

Lines changed: 170 additions & 250 deletions

doc/api/assert.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1683,7 +1683,7 @@ If no arguments are passed in at all `message` will be set to the string:
16831683
Be aware that in the `repl` the error message will be different to the one
16841684
thrown in a file! See below for further details.
16851685

1686-
<!-- eslint-skip -->
1686+
<!-- eslint-disable no-restricted-syntax -->
16871687

16881688
```mjs
16891689
import assert from 'node:assert/strict';
@@ -1720,7 +1720,7 @@ assert.ok(0);
17201720
// assert.ok(0)
17211721
```
17221722

1723-
<!-- eslint-skip -->
1723+
<!-- eslint-disable no-restricted-syntax -->
17241724

17251725
```cjs
17261726
const assert = require('node:assert/strict');

doc/api/console.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,7 @@ added: v8.3.0
240240
Maintains an internal counter specific to `label` and outputs to `stdout` the
241241
number of times `console.count()` has been called with the given `label`.
242242

243-
<!-- eslint-skip -->
244-
245-
```js
243+
```console
246244
> console.count()
247245
default: 1
248246
undefined
@@ -274,9 +272,7 @@ added: v8.3.0
274272

275273
Resets the internal counter specific to `label`.
276274

277-
<!-- eslint-skip -->
278-
279-
```js
275+
```console
280276
> console.count('abc');
281277
abc: 1
282278
undefined

doc/api/crypto.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ try {
5353
}
5454
```
5555

56-
<!-- eslint-enable no-global-assign -->
57-
5856
When using the lexical ESM `import` keyword, the error can only be
5957
caught if a handler for `process.on('uncaughtException')` is registered
6058
_before_ any attempt to load the module is made (using, for instance,

doc/api/dns.md

Lines changed: 36 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,12 @@ Returns an array of IP address strings, formatted according to [RFC 5952][],
205205
that are currently configured for DNS resolution. A string will include a port
206206
section if a custom port is used.
207207

208-
<!-- eslint-disable @stylistic/js/semi-->
209-
210-
```js
208+
```json
211209
[
212-
'8.8.8.8',
213-
'2001:4860:4860::8888',
214-
'8.8.8.8:1053',
215-
'[2001:4860:4860::8888]:1053',
210+
"8.8.8.8",
211+
"2001:4860:4860::8888",
212+
"8.8.8.8:1053",
213+
"[2001:4860:4860::8888]:1053",
216214
]
217215
```
218216

@@ -559,8 +557,6 @@ will be present on the object:
559557

560558
Here is an example of the `ret` object passed to the callback:
561559

562-
<!-- eslint-disable @stylistic/js/semi -->
563-
564560
```js
565561
[ { type: 'A', address: '127.0.0.1', ttl: 299 },
566562
{ type: 'CNAME', value: 'example.com' },
@@ -574,7 +570,7 @@ Here is an example of the `ret` object passed to the callback:
574570
refresh: 900,
575571
retry: 900,
576572
expire: 1800,
577-
minttl: 60 } ]
573+
minttl: 60 } ];
578574
```
579575

580576
DNS server operators may choose not to respond to `ANY`
@@ -678,17 +674,15 @@ function will contain an array of objects with the following properties:
678674
* `order`
679675
* `preference`
680676

681-
<!-- eslint-skip -->
682-
683677
```js
684-
{
678+
({
685679
flags: 's',
686680
service: 'SIP+D2U',
687681
regexp: '',
688682
replacement: '_sip._udp.example.com',
689683
order: 30,
690-
preference: 100
691-
}
684+
preference: 100,
685+
});
692686
```
693687

694688
## `dns.resolveNs(hostname, callback)`
@@ -763,18 +757,16 @@ be an object with the following properties:
763757
* `expire`
764758
* `minttl`
765759

766-
<!-- eslint-skip -->
767-
768760
```js
769-
{
761+
({
770762
nsname: 'ns.example.com',
771763
hostmaster: 'root.example.com',
772764
serial: 2013101809,
773765
refresh: 10000,
774766
retry: 2400,
775767
expire: 604800,
776-
minttl: 3600
777-
}
768+
minttl: 3600,
769+
});
778770
```
779771

780772
## `dns.resolveSrv(hostname, callback)`
@@ -803,15 +795,13 @@ be an array of objects with the following properties:
803795
* `port`
804796
* `name`
805797

806-
<!-- eslint-skip -->
807-
808798
```js
809-
{
799+
({
810800
priority: 10,
811801
weight: 5,
812802
port: 21223,
813-
name: 'service.example.com'
814-
}
803+
name: 'service.example.com',
804+
});
815805
```
816806

817807
## `dns.resolveTlsa(hostname, callback)`
@@ -840,15 +830,13 @@ array of objects with these properties:
840830
* `match`
841831
* `data`
842832

843-
<!-- eslint-skip -->
844-
845833
```js
846-
{
834+
({
847835
certUsage: 3,
848836
selector: 1,
849837
match: 1,
850-
data: [ArrayBuffer]
851-
}
838+
data: [ArrayBuffer],
839+
});
852840
```
853841

854842
## `dns.resolveTxt(hostname, callback)`
@@ -1081,14 +1069,12 @@ Returns an array of IP address strings, formatted according to [RFC 5952][],
10811069
that are currently configured for DNS resolution. A string will include a port
10821070
section if a custom port is used.
10831071

1084-
<!-- eslint-disable @stylistic/js/semi-->
1085-
1086-
```js
1072+
```json
10871073
[
1088-
'8.8.8.8',
1089-
'2001:4860:4860::8888',
1090-
'8.8.8.8:1053',
1091-
'[2001:4860:4860::8888]:1053',
1074+
"8.8.8.8",
1075+
"2001:4860:4860::8888",
1076+
"8.8.8.8:1053",
1077+
"[2001:4860:4860::8888]:1053"
10921078
]
10931079
```
10941080

@@ -1329,8 +1315,6 @@ present on the object:
13291315

13301316
Here is an example of the result object:
13311317

1332-
<!-- eslint-disable @stylistic/js/semi -->
1333-
13341318
```js
13351319
[ { type: 'A', address: '127.0.0.1', ttl: 299 },
13361320
{ type: 'CNAME', value: 'example.com' },
@@ -1344,7 +1328,7 @@ Here is an example of the result object:
13441328
refresh: 900,
13451329
retry: 900,
13461330
expire: 1800,
1347-
minttl: 60 } ]
1331+
minttl: 60 } ];
13481332
```
13491333

13501334
### `dnsPromises.resolveCaa(hostname)`
@@ -1407,17 +1391,15 @@ of objects with the following properties:
14071391
* `order`
14081392
* `preference`
14091393

1410-
<!-- eslint-skip -->
1411-
14121394
```js
1413-
{
1395+
({
14141396
flags: 's',
14151397
service: 'SIP+D2U',
14161398
regexp: '',
14171399
replacement: '_sip._udp.example.com',
14181400
order: 30,
1419-
preference: 100
1420-
}
1401+
preference: 100,
1402+
});
14211403
```
14221404

14231405
### `dnsPromises.resolveNs(hostname)`
@@ -1465,18 +1447,16 @@ following properties:
14651447
* `expire`
14661448
* `minttl`
14671449

1468-
<!-- eslint-skip -->
1469-
14701450
```js
1471-
{
1451+
({
14721452
nsname: 'ns.example.com',
14731453
hostmaster: 'root.example.com',
14741454
serial: 2013101809,
14751455
refresh: 10000,
14761456
retry: 2400,
14771457
expire: 604800,
1478-
minttl: 3600
1479-
}
1458+
minttl: 3600,
1459+
});
14801460
```
14811461

14821462
### `dnsPromises.resolveSrv(hostname)`
@@ -1496,15 +1476,13 @@ the following properties:
14961476
* `port`
14971477
* `name`
14981478

1499-
<!-- eslint-skip -->
1500-
15011479
```js
1502-
{
1480+
({
15031481
priority: 10,
15041482
weight: 5,
15051483
port: 21223,
1506-
name: 'service.example.com'
1507-
}
1484+
name: 'service.example.com',
1485+
});
15081486
```
15091487

15101488
### `dnsPromises.resolveTlsa(hostname)`
@@ -1526,15 +1504,13 @@ with these properties:
15261504
* `match`
15271505
* `data`
15281506

1529-
<!-- eslint-skip -->
1530-
15311507
```js
1532-
{
1508+
({
15331509
certUsage: 3,
15341510
selector: 1,
15351511
match: 1,
1536-
data: [ArrayBuffer]
1537-
}
1512+
data: [ArrayBuffer],
1513+
});
15381514
```
15391515

15401516
### `dnsPromises.resolveTxt(hostname)`

doc/api/esm.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,8 +569,6 @@ console.log(cjs === cjsSugar);
569569
This Module Namespace Exotic Object can be directly observed either when using
570570
`import * as m from 'cjs'` or a dynamic import:
571571
572-
<!-- eslint-skip -->
573-
574572
```js
575573
import * as m from 'cjs';
576574
console.log(m);

doc/api/http.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,13 @@ property, which is an array of `[key, value, key2, value2, ...]`. For
3939
example, the previous message header object might have a `rawHeaders`
4040
list like the following:
4141

42-
<!-- eslint-disable @stylistic/js/semi -->
43-
44-
```js
45-
[ 'ConTent-Length', '123456',
46-
'content-LENGTH', '123',
47-
'content-type', 'text/plain',
48-
'CONNECTION', 'keep-alive',
49-
'Host', 'example.com',
50-
'accepT', '*/*' ]
42+
```json
43+
[ "ConTent-Length", "123456",
44+
"content-LENGTH", "123",
45+
"content-type", "text/plain",
46+
"CONNECTION", "keep-alive",
47+
"Host", "example.com",
48+
"accepT", "*/*" ]
5149
```
5250

5351
## Class: `http.Agent`

doc/api/http2.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4303,10 +4303,8 @@ Accept: text/plain
43034303

43044304
Then `request.url` will be:
43054305

4306-
<!-- eslint-disable @stylistic/js/semi -->
4307-
4308-
```js
4309-
'/status?name=ryan'
4306+
```json
4307+
"/status?name=ryan"
43104308
```
43114309

43124310
To parse the url into its parts, `new URL()` can be used:

doc/api/module.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,21 +1128,17 @@ export async function load(url, context, nextLoad) {
11281128
Unlike synchronous hooks, the asynchronous hooks would not run for these modules loaded in the file
11291129
that calls `register()`:
11301130
1131-
<!-- eslint-disable no-restricted-globals -->
1132-
11331131
```mjs
11341132
// register-hooks.js
11351133
import { register, createRequire } from 'node:module';
11361134
register('./hooks.mjs', import.meta.url);
11371135

11381136
// Asynchronous hooks does not affect modules loaded via custom require()
11391137
// functions created by module.createRequire().
1140-
const userRequire = createRequire(__filename);
1138+
const userRequire = createRequire(import.meta.filename);
11411139
userRequire('./my-app-2.cjs'); // Hooks won't affect this
11421140
```
11431141
1144-
<!-- eslint-enable no-restricted-globals -->
1145-
11461142
```cjs
11471143
// register-hooks.js
11481144
const { register, createRequire } = require('node:module');

doc/api/modules.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,6 @@ the default export in the `.default` property, similar to the results returned b
262262
To customize what should be returned by `require(esm)` directly, the ES Module can export the
263263
desired value using the string name `"module.exports"`.
264264

265-
<!-- eslint-disable @stylistic/js/semi -->
266-
267265
```mjs
268266
// point.mjs
269267
export default class Point {
@@ -273,7 +271,7 @@ export default class Point {
273271
// `distance` is lost to CommonJS consumers of this module, unless it's
274272
// added to `Point` as a static property.
275273
export function distance(a, b) { return Math.sqrt((b.x - a.x) ** 2 + (b.y - a.y) ** 2); }
276-
export { Point as 'module.exports' }
274+
export { Point as 'module.exports' };
277275
```
278276

279277
<!-- eslint-disable node-core/no-duplicate-requires -->
@@ -293,8 +291,6 @@ named exports, the module can make sure that the default export is an object wit
293291
named exports attached to it as properties. For example with the example above,
294292
`distance` can be attached to the default export, the `Point` class, as a static method.
295293

296-
<!-- eslint-disable @stylistic/js/semi -->
297-
298294
```mjs
299295
export function distance(a, b) { return Math.sqrt((b.x - a.x) ** 2 + (b.y - a.y) ** 2); }
300296

@@ -303,7 +299,7 @@ export default class Point {
303299
static distance = distance;
304300
}
305301

306-
export { Point as 'module.exports' }
302+
export { Point as 'module.exports' };
307303
```
308304

309305
<!-- eslint-disable node-core/no-duplicate-requires -->

0 commit comments

Comments
 (0)