Skip to content

Commit

Permalink
squash: further lint
Browse files Browse the repository at this point in the history
  • Loading branch information
LiviaMedeiros committed Nov 18, 2024
1 parent 80273ce commit 3486885
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion doc/api/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Errors that occur within _Asynchronous APIs_ may be reported in multiple ways:
<!-- eslint-disable no-useless-return -->

```js
const fs = require('fs/promises');
const fs = require('node:fs/promises');

(async () => {
let data;
Expand Down
2 changes: 1 addition & 1 deletion doc/api/inspector.md
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ inspector.Network.requestWillBeSent({
request: {
url: 'https://nodejs.org/en',
method: 'GET',
}
},
});
```

Expand Down
2 changes: 1 addition & 1 deletion doc/api/punycode.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The `punycode` module is a bundled version of the [Punycode.js][] module. It
can be accessed using:

```js
const punycode = require('punycode');
const punycode = require('node:punycode');
```

[Punycode][] is a character encoding scheme defined by RFC 3492 that is
Expand Down
8 changes: 4 additions & 4 deletions doc/api/tls.md
Original file line number Diff line number Diff line change
Expand Up @@ -465,13 +465,13 @@ to set the security level to 0 while using the default OpenSSL cipher list, you
const tls = require('node:tls');
const port = 443;

tls.createServer({ciphers: 'DEFAULT@SECLEVEL=0', minVersion: 'TLSv1'}, function (socket) {
tls.createServer({ ciphers: 'DEFAULT@SECLEVEL=0', minVersion: 'TLSv1' }, function(socket) {
console.log('Client connected with protocol:', socket.getProtocol());
socket.end();
this.close();
}).
listen(port, () => {
tls.connect(port, {ciphers: 'DEFAULT@SECLEVEL=0', maxVersion: 'TLSv1'});
})
.listen(port, () => {
tls.connect(port, { ciphers: 'DEFAULT@SECLEVEL=0', maxVersion: 'TLSv1' });
});
```

Expand Down
2 changes: 1 addition & 1 deletion doc/api/tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ console.log(trace_events.getEnabledCategories());
```js
'use strict';

const { Session } = require('inspector');
const { Session } = require('node:inspector');
const session = new Session();
session.connect();

Expand Down
2 changes: 1 addition & 1 deletion doc/api/v8.md
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,7 @@ is as follows.
Here's an example.

```js
const { GCProfiler } = require('v8');
const { GCProfiler } = require('node:v8');
const profiler = new GCProfiler();
profiler.start();
setTimeout(() => {
Expand Down
8 changes: 4 additions & 4 deletions doc/api/vm.md
Original file line number Diff line number Diff line change
Expand Up @@ -1622,12 +1622,12 @@ in the outer context.
const vm = require('node:vm');
// An undefined `contextObject` option makes the global object contextified.
let context = vm.createContext();
const context = vm.createContext();
console.log(vm.runInContext('globalThis', context) === context); // false
// A contextified global object cannot be frozen.
try {
vm.runInContext('Object.freeze(globalThis);', context);
} catch(e) {
} catch (e) {
console.log(e); // TypeError: Cannot freeze
}
console.log(vm.runInContext('globalThis.foo = 1; foo;', context)); // 1
Expand All @@ -1652,7 +1652,7 @@ const context = vm.createContext(vm.constants.DONT_CONTEXTIFY);
vm.runInContext('Object.freeze(globalThis);', context);
try {
vm.runInContext('bar = 1; bar;', context);
} catch(e) {
} catch (e) {
console.log(e); // Uncaught ReferenceError: bar is not defined
}
```
Expand Down Expand Up @@ -1681,7 +1681,7 @@ console.log(vm.runInContext('bar;', context)); // 1
Object.freeze(context);
try {
vm.runInContext('baz = 1; baz;', context);
} catch(e) {
} catch (e) {
console.log(e); // Uncaught ReferenceError: baz is not defined
}
```
Expand Down
4 changes: 3 additions & 1 deletion doc/api/worker_threads.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ markAsUncloneable(anyObject);
const { port1 } = new MessageChannel();
try {
// This will throw an error, because anyObject is not cloneable.
port1.postMessage(anyObject)
port1.postMessage(anyObject);
} catch (error) {
// error.name === 'DataCloneError'
}
Expand Down Expand Up @@ -910,6 +910,8 @@ not preserved. In particular, [`Buffer`][] objects will be read as
plain [`Uint8Array`][]s on the receiving side, and instances of JavaScript
classes will be cloned as plain JavaScript objects.
<!-- eslint-disable no-unused-private-class-members -->
```js
const b = Symbol('b');

Expand Down
5 changes: 1 addition & 4 deletions doc/api/zlib.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,7 @@ http.createServer((request, response) => {
const raw = fs.createReadStream('index.html');
// Store both a compressed and an uncompressed version of the resource.
response.setHeader('Vary', 'Accept-Encoding');
let acceptEncoding = request.headers['accept-encoding'];
if (!acceptEncoding) {
acceptEncoding = '';
}
const acceptEncoding = request.headers['accept-encoding'] || '';

const onError = (err) => {
if (err) {
Expand Down
2 changes: 1 addition & 1 deletion doc/contributing/writing-and-running-benchmarks.md
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ The arguments of `createBenchmark` are:
source: ['buffer', 'string'],
len: [2048],
n: [50, 2048],
}
},
}, { byGroups: true });
```

Expand Down

0 comments on commit 3486885

Please sign in to comment.