From 08c3b0ab202f72cfe1697c04d40fb041dd5f8e65 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 22 Nov 2023 20:03:33 +0100 Subject: [PATCH] doc: get rid of unnecessary `eslint-skip` comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/50829 Reviewed-By: Luigi Pinca Reviewed-By: Ethan Arrowood Reviewed-By: Yagiz Nizipli Reviewed-By: Paolo Insogna Reviewed-By: Tobias Nießen Reviewed-By: Marco Ippolito --- doc/api/crypto.md | 4 +++- doc/api/errors.md | 4 +--- doc/api/http.md | 14 ++++++-------- doc/api/https.md | 2 -- doc/api/querystring.md | 8 +++----- doc/api/tls.md | 2 -- doc/api/util.md | 4 +--- 7 files changed, 14 insertions(+), 24 deletions(-) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 93f0bd3c1a169f..3175d391032ae4 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -42,7 +42,7 @@ calling `require('node:crypto')` will result in an error being thrown. When using CommonJS, the error thrown can be caught using try/catch: - + ```cjs let crypto; @@ -53,6 +53,8 @@ try { } ``` + + When using the lexical ESM `import` keyword, the error can only be caught if a handler for `process.on('uncaughtException')` is registered _before_ any attempt to load the module is made (using, for instance, diff --git a/doc/api/errors.md b/doc/api/errors.md index 50e9f658fcbf3a..ad7b813f80e2b1 100644 --- a/doc/api/errors.md +++ b/doc/api/errors.md @@ -2938,9 +2938,7 @@ signal (such as [`subprocess.kill()`][]). [self-reference a package using its name][] and [define a custom subpath][] in the [`"exports"`][] field of the [`package.json`][] file. - - -```js +```mjs import './'; // unsupported import './index.js'; // supported import 'package-name'; // supported diff --git a/doc/api/http.md b/doc/api/http.md index 11b01b6e9ee767..e0b2c55a56a3d0 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -16,14 +16,12 @@ user is able to stream data. HTTP message headers are represented by an object like this: - - -```js -{ 'content-length': '123', - 'content-type': 'text/plain', - 'connection': 'keep-alive', - 'host': 'example.com', - 'accept': '*/*' } +```json +{ "content-length": "123", + "content-type": "text/plain", + "connection": "keep-alive", + "host": "example.com", + "accept": "*/*" } ``` Keys are lowercased. Values are not modified. diff --git a/doc/api/https.md b/doc/api/https.md index 20f427d3b7dfd9..8ae80d28b61654 100644 --- a/doc/api/https.md +++ b/doc/api/https.md @@ -17,8 +17,6 @@ calling `require('node:https')` will result in an error being thrown. When using CommonJS, the error thrown can be caught using try/catch: - - ```cjs let https; try { diff --git a/doc/api/querystring.md b/doc/api/querystring.md index 752d4b9d584242..f7f45d57d927ce 100644 --- a/doc/api/querystring.md +++ b/doc/api/querystring.md @@ -87,12 +87,10 @@ collection of key and value pairs. For example, the query string `'foo=bar&abc=xyz&abc=123'` is parsed into: - - -```js +```json { - foo: 'bar', - abc: ['xyz', '123'] + "foo": "bar", + "abc": ["xyz", "123"] } ``` diff --git a/doc/api/tls.md b/doc/api/tls.md index 37f26189e5e62e..79544012484589 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -22,8 +22,6 @@ calling `require('node:tls')` will result in an error being thrown. When using CommonJS, the error thrown can be caught using try/catch: - - ```cjs let tls; try { diff --git a/doc/api/util.md b/doc/api/util.md index bf154500f64e3e..4e7cb2e6dd1629 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -2513,9 +2513,7 @@ added: v10.0.0 Returns `true` if the value is an instance of a [Module Namespace Object][]. - - -```js +```mjs import * as ns from './a.js'; util.types.isModuleNamespaceObject(ns); // Returns true