Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: lint js in doc/**/*.md #55904

Merged
merged 3 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/api/esm.md
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ module default import or its corresponding sugar syntax:

```js
import { default as cjs } from 'cjs';
// identical to the above
// Identical to the above
import cjsSugar from 'cjs';

console.log(cjs);
Expand Down
2 changes: 1 addition & 1 deletion doc/api/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ built-in modules and if a name matching a built-in module is added to the cache,
only `node:`-prefixed require calls are going to receive the built-in module.
Use with care!

<!-- eslint-disable node-core/no-duplicate-requires -->
<!-- eslint-disable node-core/no-duplicate-requires, no-restricted-syntax -->

```js
const assert = require('node:assert');
Expand Down
2 changes: 1 addition & 1 deletion doc/api/perf_hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ performance.measure('Start to Now');

performance.mark('A');
(async function doSomeLongRunningProcess() {
await new Promise(r => setTimeout(r, 5000));
await new Promise((r) => setTimeout(r, 5000));
performance.measure('A to Now', 'A');

performance.mark('B');
Expand Down
6 changes: 3 additions & 3 deletions doc/api/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -2111,10 +2111,10 @@ class Test {
constructor() {
finalization.register(this, (ref) => ref.dispose());

// even something like this is highly discouraged
// Even something like this is highly discouraged
// finalization.register(this, () => this.dispose());
}
dispose() {}
}
dispose() {}
}
```

Expand Down
4 changes: 2 additions & 2 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ events (due to incorrect stream implementations) do not cause unexpected
crashes. If this is unwanted behavior then `options.cleanup` should be set to
`true`:

```js
```mjs
await finished(rs, { cleanup: true });
```

Expand Down Expand Up @@ -3926,7 +3926,7 @@ const { StringDecoder } = require('node:string_decoder');
class StringWritable extends Writable {
constructor(options) {
super(options);
this._decoder = new StringDecoder(options && options.defaultEncoding);
this._decoder = new StringDecoder(options?.defaultEncoding);
this.data = '';
}
_write(chunk, encoding, callback) {
Expand Down
2 changes: 1 addition & 1 deletion doc/api/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -3284,7 +3284,7 @@ test('snapshot test with default serialization', (t) => {

test('snapshot test with custom serialization', (t) => {
t.assert.snapshot({ value3: 3, value4: 4 }, {
serializers: [(value) => JSON.stringify(value)]
serializers: [(value) => JSON.stringify(value)],
});
});
```
Expand Down
2 changes: 1 addition & 1 deletion doc/api/util.md
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ The mapping between error codes and string messages is platform-dependent.
```js
fs.access('file/that/does/not/exist', (err) => {
const name = util.getSystemErrorMessage(err.errno);
console.error(name); // no such file or directory
console.error(name); // No such file or directory
});
```

Expand Down
3 changes: 1 addition & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ export default [
'**/node_modules/**',
'benchmark/fixtures/**',
'benchmark/tmp/**',
'doc/**/*.js',
'doc/changelogs/CHANGELOG_V1*.md',
'!doc/api_assets/*.js',
'!doc/changelogs/CHANGELOG_V18.md',
'doc/changelogs/CHANGELOG_V23.md',
'lib/punycode.js',
'test/.tmp.*/**',
'test/addons/??_*',
Expand Down
Loading