Skip to content

Commit b3265dc

Browse files
authored
Merge branch 'nodejs:master' into patch-10
2 parents 08eb3c5 + 59db172 commit b3265dc

File tree

22,980 files changed

+4889700
-2187158
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

22,980 files changed

+4889700
-2187158
lines changed

.eslintignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ test/addons/??_*
44
test/fixtures
55
test/message/esm_display_syntax_error.mjs
66
tools/icu
7-
tools/lint-md.js
8-
tools/node-lint-md-cli-rollup/dist
7+
tools/lint-md/lint-md.mjs
98
benchmark/tmp
109
doc/**/*.js
1110
!.eslintrc.js

.eslintrc.js

Lines changed: 55 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,17 @@ NodePlugin.RULES_DIR = path.resolve(__dirname, 'tools', 'eslint-rules');
1515
const ModuleFindPath = Module._findPath;
1616
const hacks = [
1717
'eslint-plugin-node-core',
18+
'eslint-plugin-jsdoc',
1819
'eslint-plugin-markdown',
1920
'@babel/eslint-parser',
20-
'@babel/plugin-syntax-class-properties',
21-
'@babel/plugin-syntax-top-level-await',
21+
'@babel/plugin-syntax-import-assertions',
2222
];
2323
Module._findPath = (request, paths, isMain) => {
2424
const r = ModuleFindPath(request, paths, isMain);
2525
if (!r && hacks.includes(request)) {
2626
try {
2727
return require.resolve(`./tools/node_modules/${request}`);
28-
// Keep the variable in place to ensure that ESLint started by older Node.js
29-
// versions work as expected.
30-
// eslint-disable-next-line no-unused-vars
31-
} catch (e) {
28+
} catch {
3229
return require.resolve(
3330
`./tools/node_modules/eslint/node_modules/${request}`);
3431
}
@@ -38,13 +35,13 @@ Module._findPath = (request, paths, isMain) => {
3835

3936
module.exports = {
4037
root: true,
41-
plugins: ['markdown', 'node-core'],
38+
extends: ['plugin:jsdoc/recommended'],
39+
plugins: ['jsdoc', 'markdown', 'node-core'],
4240
parser: '@babel/eslint-parser',
4341
parserOptions: {
4442
babelOptions: {
4543
plugins: [
46-
Module._findPath('@babel/plugin-syntax-class-properties'),
47-
Module._findPath('@babel/plugin-syntax-top-level-await'),
44+
Module._findPath('@babel/plugin-syntax-import-assertions'),
4845
],
4946
},
5047
requireConfigFile: false,
@@ -79,6 +76,37 @@ module.exports = {
7976
'doc/api/packages.md/*.js',
8077
],
8178
parserOptions: { sourceType: 'module' },
79+
rules: { 'no-restricted-globals': [
80+
'error',
81+
{
82+
name: '__filename',
83+
message: 'Use import.meta.url instead',
84+
},
85+
{
86+
name: '__dirname',
87+
message: 'Not available in ESM',
88+
},
89+
{
90+
name: 'exports',
91+
message: 'Not available in ESM',
92+
},
93+
{
94+
name: 'module',
95+
message: 'Not available in ESM',
96+
},
97+
{
98+
name: 'require',
99+
message: 'Use import instead',
100+
},
101+
{
102+
name: 'Buffer',
103+
message: 'Import Buffer instead of using the global'
104+
},
105+
{
106+
name: 'process',
107+
message: 'Import process instead of using the global'
108+
},
109+
] },
82110
},
83111
],
84112
rules: {
@@ -285,6 +313,7 @@ module.exports = {
285313
{ blankLine: 'always', prev: 'function', next: 'function' },
286314
],
287315
'prefer-const': ['error', { ignoreReadBeforeAssign: true }],
316+
'prefer-object-has-own': 'error',
288317
'quotes': ['error', 'single', { avoidEscape: true }],
289318
'quote-props': ['error', 'consistent'],
290319
'rest-spread-spacing': 'error',
@@ -310,6 +339,19 @@ module.exports = {
310339
'use-isnan': 'error',
311340
'valid-typeof': ['error', { requireStringLiterals: true }],
312341

342+
// JSDoc rules
343+
'jsdoc/require-jsdoc': 'off',
344+
'jsdoc/require-param-description': 'off',
345+
'jsdoc/newline-after-description': 'off',
346+
'jsdoc/require-returns-description': 'off',
347+
'jsdoc/valid-types': 'off',
348+
'jsdoc/no-undefined-types': 'off',
349+
'jsdoc/require-param': 'off',
350+
'jsdoc/check-tag-names': 'off',
351+
'jsdoc/require-returns': 'off',
352+
'jsdoc/require-property-description': 'off',
353+
'jsdoc/check-param-names': 'off',
354+
313355
// Custom rules from eslint-plugin-node-core
314356
'node-core/no-unescaped-regexp-dot': 'error',
315357
'node-core/no-duplicate-requires': 'error',
@@ -321,9 +363,12 @@ module.exports = {
321363
BigInt: 'readable',
322364
BigInt64Array: 'readable',
323365
BigUint64Array: 'readable',
366+
Blob: 'readable',
367+
DOMException: 'readable',
324368
Event: 'readable',
325369
EventTarget: 'readable',
326370
MessageChannel: 'readable',
371+
BroadcastChannel: 'readable',
327372
MessageEvent: 'readable',
328373
MessagePort: 'readable',
329374
TextEncoder: 'readable',
@@ -333,5 +378,6 @@ module.exports = {
333378
btoa: 'readable',
334379
atob: 'readable',
335380
performance: 'readable',
381+
structuredClone: 'readable',
336382
},
337383
};

.github/CODEOWNERS

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,17 @@
55
# 3. PRs touching any code with a codeowner must be signed off by at least one
66
# person on the code owner team.
77

8-
# tsc & commcomm
8+
# tsc
99

1010
/.github/CODEOWNERS @nodejs/tsc
1111
/GOVERNANCE.md @nodejs/tsc
1212
/onboarding.md @nodejs/tsc
13-
/CODE_OF_CONDUCT.md @nodejs/tsc @nodejs/community-committee
14-
/CONTRIBUTING.md @nodejs/tsc @nodejs/community-committee
15-
/LICENSE @nodejs/tsc @nodejs/community-committee
16-
/doc/guides/contributing/code-of-conduct.md @nodejs/tsc @nodejs/community-committee
17-
# TODO(mmarchini): the bot doens't have a notion of precedence, that might
18-
# change when move the codeowners code to an Action, at which point we can
19-
# uncomment the line below
20-
# /doc/guides/contributing/*.md @nodejs/tsc
21-
/doc/guides/contributing/issues.md @nodejs/tsc
22-
/doc/guides/contributing/pull-requests.md @nodejs/tsc
13+
/CODE_OF_CONDUCT.md @nodejs/tsc
14+
/CONTRIBUTING.md @nodejs/tsc
15+
/LICENSE @nodejs/tsc
16+
/doc/guides/contributing/*.md @nodejs/tsc
2317
/doc/guides/collaborator-guide.md @nodejs/tsc
2418
/doc/guides/offboarding.md @nodejs/tsc
25-
/doc/guides/onboarding-extras.md @nodejs/tsc
2619

2720
# streams
2821

@@ -55,7 +48,7 @@
5548
# tls/crypto
5649

5750
/lib/internal/crypto/* @nodejs/crypto
58-
/lib/internal/tls.js @nodejs/crypto @nodejs/net
51+
/lib/internal/tls/* @nodejs/crypto @nodejs/net
5952
/lib/crypto.js @nodejs/crypto
6053
/lib/tls.js @nodejs/crypto @nodejs/net
6154
/src/node_crypto* @nodejs/crypto
@@ -91,12 +84,18 @@
9184
/lib/internal/bootstrap/loaders.js @nodejs/modules
9285
/src/module_wrap* @nodejs/modules @nodejs/vm
9386

94-
# N-API
87+
# Node-API
9588

96-
/src/node_api* @nodejs/n-api
97-
/src/js_native_api* @nodejs/n-api
98-
/doc/guides/adding-new-napi-api.md @nodejs/n-api
99-
/doc/api/n-api.md @nodejs/n-api
89+
/src/node_api* @nodejs/node-api
90+
/src/js_native_api* @nodejs/node-api
91+
/doc/guides/adding-new-napi-api.md @nodejs/node-api
92+
/doc/api/n-api.md @nodejs/node-api
93+
94+
# gyp
95+
96+
*.gyp @nodejs/gyp
97+
*.gypi @nodejs/gyp
98+
/tools/gyp/**/* @nodejs/gyp
10099

101100
# WASI
102101
/deps/uvwasi/ @nodejs/wasi
@@ -115,3 +114,12 @@
115114
/lib/internal/bootstrap/* @nodejs/startup
116115
/tools/code_cache/* @nodejs/startup
117116
/tools/snapshot/* @nodejs/startup
117+
118+
# V8
119+
/deps/v8/* @nodejs/v8-update
120+
/tools/v8_gypfiles/* @nodejs/v8-update
121+
122+
# Actions
123+
124+
/.github/workflows/* @nodejs/actions
125+
/tools/actions/* @nodejs/actions

.github/ISSUE_TEMPLATE/1-bug-report.md

Lines changed: 0 additions & 51 deletions
This file was deleted.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: "\U0001F41B Bug report"
2+
description: Create a report to help us improve
3+
body:
4+
- type: markdown
5+
attributes:
6+
value: |
7+
Thank you for reporting an issue.
8+
9+
This issue tracker is for bugs and issues found within Node.js core.
10+
If you require more general support please file an issue on our help repo. https://github.com/nodejs/help
11+
12+
Please fill in as much of the form below as you're able.
13+
- type: input
14+
attributes:
15+
label: Version
16+
description: Output of `node -v`
17+
- type: input
18+
attributes:
19+
label: Platform
20+
description: |
21+
UNIX: output of `uname -a`
22+
Windows: output of `"$([Environment]::OSVersion | ForEach-Object VersionString) $(if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" })"` in PowerShell console
23+
- type: input
24+
attributes:
25+
label: Subsystem
26+
description: If known, please specify affected core module name
27+
- type: textarea
28+
attributes:
29+
label: What steps will reproduce the bug?
30+
description: Enter details about your bug, preferably a simple code snippet that can be run using `node` directly without installing third-party dependencies.
31+
- type: textarea
32+
attributes:
33+
label: How often does it reproduce? Is there a required condition?
34+
- type: textarea
35+
attributes:
36+
label: What is the expected behavior?
37+
description: If possible please provide textual output instead of screenshots.
38+
- type: textarea
39+
attributes:
40+
label: What do you see instead?
41+
description: If possible please provide textual output instead of screenshots.
42+
- type: textarea
43+
attributes:
44+
label: Additional information
45+
description: Tell us anything else you think we should know.

.github/ISSUE_TEMPLATE/2-feature-request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: "\U0001F680 Feature request"
33
about: Suggest an idea for this project
4-
4+
labels: feature request
55
---
66

77
<!--

.github/ISSUE_TEMPLATE/4-report-a-flaky-test.md

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)