Skip to content

Commit 527ff4d

Browse files
authored
Merge branch 'main' into stop-immediate-propagation-flags
2 parents 23744d2 + 7202859 commit 527ff4d

File tree

30,492 files changed

+6041760
-3283900
lines changed

Some content is hidden

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

30,492 files changed

+6041760
-3283900
lines changed

.devcontainer/.devcontainer.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "Node.js Core Developer Environment",
3+
"extensions": [
4+
"github.vscode-pull-request-github",
5+
"ms-vsliveshare.vsliveshare",
6+
"vscode-icons-team.vscode-icons",
7+
"visualstudioexptteam.vscodeintellicode"
8+
],
9+
"dockerFile": "Dockerfile",
10+
"initializeCommand": "docker system prune -f -a",
11+
"settings": {
12+
"terminal.integrated.profiles.linux": {
13+
"zsh (login)": {
14+
"path": "zsh",
15+
"args": ["-l"]
16+
}
17+
}
18+
}
19+
}

.devcontainer/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM nodejs/devcontainer:nightly

.eslintignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ 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
9+
benchmark/fixtures
1010
doc/**/*.js
11+
!doc/api_assets/*.js
1112
!.eslintrc.js

.eslintrc.js

Lines changed: 71 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ 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);
@@ -35,13 +35,16 @@ Module._findPath = (request, paths, isMain) => {
3535

3636
module.exports = {
3737
root: true,
38-
plugins: ['markdown', 'node-core'],
38+
env: {
39+
es2022: true,
40+
},
41+
extends: ['eslint:recommended', 'plugin:jsdoc/recommended'],
42+
plugins: ['jsdoc', 'markdown', 'node-core'],
3943
parser: '@babel/eslint-parser',
4044
parserOptions: {
4145
babelOptions: {
4246
plugins: [
43-
Module._findPath('@babel/plugin-syntax-class-properties'),
44-
Module._findPath('@babel/plugin-syntax-top-level-await'),
47+
Module._findPath('@babel/plugin-syntax-import-assertions'),
4548
],
4649
},
4750
requireConfigFile: false,
@@ -65,7 +68,7 @@ module.exports = {
6568
files: ['**/*.md/*.cjs', '**/*.md/*.js'],
6669
parserOptions: {
6770
sourceType: 'script',
68-
ecmaFeatures: { impliedStrict: true }
71+
ecmaFeatures: { impliedStrict: true },
6972
},
7073
rules: { strict: 'off' },
7174
},
@@ -100,11 +103,11 @@ module.exports = {
100103
},
101104
{
102105
name: 'Buffer',
103-
message: 'Import Buffer instead of using the global'
106+
message: 'Import Buffer instead of using the global',
104107
},
105108
{
106109
name: 'process',
107-
message: 'Import process instead of using the global'
110+
message: 'Import process instead of using the global',
108111
},
109112
] },
110113
},
@@ -114,45 +117,35 @@ module.exports = {
114117
// https://eslint.org/docs/rules/
115118
'accessor-pairs': 'error',
116119
'array-callback-return': 'error',
117-
'arrow-parens': ['error', 'always'],
118-
'arrow-spacing': ['error', { before: true, after: true }],
120+
'arrow-parens': 'error',
121+
'arrow-spacing': 'error',
119122
'block-scoped-var': 'error',
120123
'block-spacing': 'error',
121124
'brace-style': ['error', '1tbs', { allowSingleLine: true }],
122125
'capitalized-comments': ['error', 'always', {
123126
line: {
124127
// Ignore all lines that have less characters than 20 and all lines that
125128
// start with something that looks like a variable name or code.
126-
// eslint-disable-next-line max-len
127-
ignorePattern: '.{0,20}$|[a-z]+ ?[0-9A-Z_.(/=:[#-]|std|http|ssh|ftp|(let|var|const) [a-z_A-Z0-9]+ =|[b-z] |[a-z]*[0-9].* ',
129+
ignorePattern: '.{0,20}$|[a-z]+ ?[0-9A-Z_.(/=:[#-]|std|http|ssh|ftp',
128130
ignoreInlineComments: true,
129131
ignoreConsecutiveComments: true,
130132
},
131133
block: {
132134
ignorePattern: '.*',
133135
},
134136
}],
135-
'comma-dangle': ['error', {
136-
arrays: 'always-multiline',
137-
exports: 'only-multiline',
138-
functions: 'only-multiline',
139-
imports: 'only-multiline',
140-
objects: 'only-multiline',
141-
}],
137+
'comma-dangle': ['error', 'always-multiline'],
142138
'comma-spacing': 'error',
143139
'comma-style': 'error',
144140
'computed-property-spacing': 'error',
145-
'constructor-super': 'error',
146141
'default-case-last': 'error',
147142
'dot-location': ['error', 'property'],
148143
'dot-notation': 'error',
149144
'eol-last': 'error',
150145
'eqeqeq': ['error', 'smart'],
151-
'for-direction': 'error',
152146
'func-call-spacing': 'error',
153147
'func-name-matching': 'error',
154148
'func-style': ['error', 'declaration', { allowArrowFunctions: true }],
155-
'getter-return': 'error',
156149
'indent': ['error', 2, {
157150
ArrayExpression: 'first',
158151
CallExpression: { arguments: 'first' },
@@ -162,59 +155,33 @@ module.exports = {
162155
ObjectExpression: 'first',
163156
SwitchCase: 1,
164157
}],
165-
'key-spacing': ['error', { mode: 'strict' }],
158+
'key-spacing': 'error',
166159
'keyword-spacing': 'error',
167-
'linebreak-style': ['error', 'unix'],
160+
'linebreak-style': 'error',
168161
'max-len': ['error', {
169-
code: 80,
162+
code: 120,
170163
ignorePattern: '^// Flags:',
171164
ignoreRegExpLiterals: true,
172165
ignoreTemplateLiterals: true,
173166
ignoreUrls: true,
174167
tabWidth: 2,
175168
}],
176169
'new-parens': 'error',
177-
'no-async-promise-executor': 'error',
178-
'no-class-assign': 'error',
179170
'no-confusing-arrow': 'error',
180-
'no-const-assign': 'error',
171+
'no-constant-condition': ['error', { checkLoops: false }],
181172
'no-constructor-return': 'error',
182-
'no-control-regex': 'error',
183-
'no-debugger': 'error',
184-
'no-delete-var': 'error',
185-
'no-dupe-args': 'error',
186-
'no-dupe-class-members': 'error',
187-
'no-dupe-keys': 'error',
188-
'no-dupe-else-if': 'error',
189-
'no-duplicate-case': 'error',
190173
'no-duplicate-imports': 'error',
191-
'no-else-return': ['error', { allowElseIf: true }],
192-
'no-empty-character-class': 'error',
193-
'no-ex-assign': 'error',
194-
'no-extra-boolean-cast': 'error',
174+
'no-else-return': 'error',
195175
'no-extra-parens': ['error', 'functions'],
196-
'no-extra-semi': 'error',
197-
'no-fallthrough': 'error',
198-
'no-func-assign': 'error',
199-
'no-global-assign': 'error',
200-
'no-invalid-regexp': 'error',
201-
'no-irregular-whitespace': 'error',
202176
'no-lonely-if': 'error',
203-
'no-misleading-character-class': 'error',
204177
'no-mixed-requires': 'error',
205-
'no-mixed-spaces-and-tabs': 'error',
206178
'no-multi-spaces': ['error', { ignoreEOLComments: true }],
207179
'no-multiple-empty-lines': ['error', { max: 2, maxEOF: 0, maxBOF: 0 }],
208180
'no-new-require': 'error',
209-
'no-new-symbol': 'error',
210-
'no-nonoctal-decimal-escape': 'error',
211-
'no-obj-calls': 'error',
212-
'no-octal': 'error',
213181
'no-path-concat': 'error',
214182
'no-proto': 'error',
215183
'no-redeclare': ['error', { 'builtinGlobals': false }],
216184
'no-restricted-modules': ['error', 'sys'],
217-
/* eslint-disable max-len */
218185
'no-restricted-properties': [
219186
'error',
220187
{
@@ -266,43 +233,35 @@ module.exports = {
266233
selector: "CallExpression[callee.name='isNaN']",
267234
message: 'Use Number.isNaN() instead of the global isNaN() function.',
268235
},
236+
{
237+
// TODO(@panva): move this to no-restricted-properties
238+
// when https://github.com/eslint/eslint/issues/16412 is fixed
239+
selector: "Identifier[name='webcrypto']",
240+
message: 'Use `globalThis.crypto`.',
241+
},
269242
],
270-
/* eslint-enable max-len */
271243
'no-return-await': 'error',
272-
'no-self-assign': 'error',
273244
'no-self-compare': 'error',
274-
'no-setter-return': 'error',
275-
'no-shadow-restricted-names': 'error',
276245
'no-tabs': 'error',
277246
'no-template-curly-in-string': 'error',
278-
'no-this-before-super': 'error',
279247
'no-throw-literal': 'error',
280248
'no-trailing-spaces': 'error',
281249
'no-undef': ['error', { typeof: true }],
282250
'no-undef-init': 'error',
283-
'no-unexpected-multiline': 'error',
284-
'no-unreachable': 'error',
285-
'no-unsafe-finally': 'error',
286-
'no-unsafe-negation': 'error',
287-
'no-unsafe-optional-chaining': 'error',
288251
'no-unused-expressions': ['error', { allowShortCircuit: true }],
289-
'no-unused-labels': 'error',
290252
'no-unused-vars': ['error', { args: 'none', caughtErrors: 'all' }],
291253
'no-use-before-define': ['error', {
292254
classes: true,
293255
functions: false,
294256
variables: false,
295257
}],
296-
'no-useless-backreference': 'error',
297258
'no-useless-call': 'error',
298-
'no-useless-catch': 'error',
299259
'no-useless-concat': 'error',
300260
'no-useless-constructor': 'error',
301-
'no-useless-escape': 'error',
302261
'no-useless-return': 'error',
262+
'no-var': 'error',
303263
'no-void': 'error',
304264
'no-whitespace-before-property': 'error',
305-
'no-with': 'error',
306265
'object-curly-newline': 'error',
307266
'object-curly-spacing': ['error', 'always'],
308267
'one-var': ['error', { initialized: 'never' }],
@@ -313,6 +272,7 @@ module.exports = {
313272
{ blankLine: 'always', prev: 'function', next: 'function' },
314273
],
315274
'prefer-const': ['error', { ignoreReadBeforeAssign: true }],
275+
'prefer-object-has-own': 'error',
316276
'quotes': ['error', 'single', { avoidEscape: true }],
317277
'quote-props': ['error', 'consistent'],
318278
'rest-spread-spacing': 'error',
@@ -324,7 +284,7 @@ module.exports = {
324284
named: 'never',
325285
asyncArrow: 'always',
326286
}],
327-
'space-in-parens': ['error', 'never'],
287+
'space-in-parens': 'error',
328288
'space-infix-ops': 'error',
329289
'space-unary-ops': 'error',
330290
'spaced-comment': ['error', 'always', {
@@ -335,31 +295,54 @@ module.exports = {
335295
'symbol-description': 'error',
336296
'template-curly-spacing': 'error',
337297
'unicode-bom': 'error',
338-
'use-isnan': 'error',
339298
'valid-typeof': ['error', { requireStringLiterals: true }],
340299

300+
// ESLint recommended rules that we disable
301+
'no-inner-declarations': 'off',
302+
303+
// JSDoc recommended rules that we disable
304+
'jsdoc/require-jsdoc': 'off',
305+
'jsdoc/require-param-description': 'off',
306+
'jsdoc/newline-after-description': 'off',
307+
'jsdoc/require-returns-description': 'off',
308+
'jsdoc/valid-types': 'off',
309+
'jsdoc/no-defaults': 'off',
310+
'jsdoc/no-undefined-types': 'off',
311+
'jsdoc/require-param': 'off',
312+
'jsdoc/check-tag-names': 'off',
313+
'jsdoc/require-returns': 'off',
314+
341315
// Custom rules from eslint-plugin-node-core
342316
'node-core/no-unescaped-regexp-dot': 'error',
343317
'node-core/no-duplicate-requires': 'error',
318+
'node-core/prefer-proto': 'error',
344319
},
345320
globals: {
346-
AbortController: 'readable',
347-
AbortSignal: 'readable',
348-
Atomics: 'readable',
349-
BigInt: 'readable',
350-
BigInt64Array: 'readable',
351-
BigUint64Array: 'readable',
352-
Event: 'readable',
353-
EventTarget: 'readable',
354-
MessageChannel: 'readable',
355-
MessageEvent: 'readable',
356-
MessagePort: 'readable',
357-
TextEncoder: 'readable',
358-
TextDecoder: 'readable',
359-
queueMicrotask: 'readable',
360-
globalThis: 'readable',
361-
btoa: 'readable',
362-
atob: 'readable',
363-
performance: 'readable',
321+
ByteLengthQueuingStrategy: 'readable',
322+
CompressionStream: 'readable',
323+
CountQueuingStrategy: 'readable',
324+
CustomEvent: 'readable',
325+
crypto: 'readable',
326+
Crypto: 'readable',
327+
CryptoKey: 'readable',
328+
DecompressionStream: 'readable',
329+
fetch: 'readable',
330+
FormData: 'readable',
331+
ReadableStream: 'readable',
332+
ReadableStreamDefaultReader: 'readable',
333+
ReadableStreamBYOBReader: 'readable',
334+
ReadableStreamBYOBRequest: 'readable',
335+
ReadableByteStreamController: 'readable',
336+
ReadableStreamDefaultController: 'readable',
337+
Response: 'readable',
338+
TextDecoderStream: 'readable',
339+
TextEncoderStream: 'readable',
340+
TransformStream: 'readable',
341+
TransformStreamDefaultController: 'readable',
342+
ShadowRealm: 'readable',
343+
SubtleCrypto: 'readable',
344+
WritableStream: 'readable',
345+
WritableStreamDefaultWriter: 'readable',
346+
WritableStreamDefaultController: 'readable',
364347
},
365348
};

.flake8

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

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
test/fixtures/* -text
22
vcbuild.bat text eol=crlf
3+
deps/npm/bin/npm text eol=lf
4+
deps/npm/bin/npx text eol=lf
5+
deps/corepack/shims/corepack text eol=lf
36
tools/msvs/find_python.cmd text eol=crlf

0 commit comments

Comments
 (0)