Skip to content

Commit

Permalink
Merge branch 'nodejs:master' into patch-10
Browse files Browse the repository at this point in the history
  • Loading branch information
pd4d10 authored Dec 27, 2021
2 parents 08eb3c5 + 59db172 commit b3265dc
Show file tree
Hide file tree
Showing 22,980 changed files with 4,889,700 additions and 2,187,158 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 1 addition & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ test/addons/??_*
test/fixtures
test/message/esm_display_syntax_error.mjs
tools/icu
tools/lint-md.js
tools/node-lint-md-cli-rollup/dist
tools/lint-md/lint-md.mjs
benchmark/tmp
doc/**/*.js
!.eslintrc.js
64 changes: 55 additions & 9 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,17 @@ NodePlugin.RULES_DIR = path.resolve(__dirname, 'tools', 'eslint-rules');
const ModuleFindPath = Module._findPath;
const hacks = [
'eslint-plugin-node-core',
'eslint-plugin-jsdoc',
'eslint-plugin-markdown',
'@babel/eslint-parser',
'@babel/plugin-syntax-class-properties',
'@babel/plugin-syntax-top-level-await',
'@babel/plugin-syntax-import-assertions',
];
Module._findPath = (request, paths, isMain) => {
const r = ModuleFindPath(request, paths, isMain);
if (!r && hacks.includes(request)) {
try {
return require.resolve(`./tools/node_modules/${request}`);
// Keep the variable in place to ensure that ESLint started by older Node.js
// versions work as expected.
// eslint-disable-next-line no-unused-vars
} catch (e) {
} catch {
return require.resolve(
`./tools/node_modules/eslint/node_modules/${request}`);
}
Expand All @@ -38,13 +35,13 @@ Module._findPath = (request, paths, isMain) => {

module.exports = {
root: true,
plugins: ['markdown', 'node-core'],
extends: ['plugin:jsdoc/recommended'],
plugins: ['jsdoc', 'markdown', 'node-core'],
parser: '@babel/eslint-parser',
parserOptions: {
babelOptions: {
plugins: [
Module._findPath('@babel/plugin-syntax-class-properties'),
Module._findPath('@babel/plugin-syntax-top-level-await'),
Module._findPath('@babel/plugin-syntax-import-assertions'),
],
},
requireConfigFile: false,
Expand Down Expand Up @@ -79,6 +76,37 @@ module.exports = {
'doc/api/packages.md/*.js',
],
parserOptions: { sourceType: 'module' },
rules: { 'no-restricted-globals': [
'error',
{
name: '__filename',
message: 'Use import.meta.url instead',
},
{
name: '__dirname',
message: 'Not available in ESM',
},
{
name: 'exports',
message: 'Not available in ESM',
},
{
name: 'module',
message: 'Not available in ESM',
},
{
name: 'require',
message: 'Use import instead',
},
{
name: 'Buffer',
message: 'Import Buffer instead of using the global'
},
{
name: 'process',
message: 'Import process instead of using the global'
},
] },
},
],
rules: {
Expand Down Expand Up @@ -285,6 +313,7 @@ module.exports = {
{ blankLine: 'always', prev: 'function', next: 'function' },
],
'prefer-const': ['error', { ignoreReadBeforeAssign: true }],
'prefer-object-has-own': 'error',
'quotes': ['error', 'single', { avoidEscape: true }],
'quote-props': ['error', 'consistent'],
'rest-spread-spacing': 'error',
Expand All @@ -310,6 +339,19 @@ module.exports = {
'use-isnan': 'error',
'valid-typeof': ['error', { requireStringLiterals: true }],

// JSDoc rules
'jsdoc/require-jsdoc': 'off',
'jsdoc/require-param-description': 'off',
'jsdoc/newline-after-description': 'off',
'jsdoc/require-returns-description': 'off',
'jsdoc/valid-types': 'off',
'jsdoc/no-undefined-types': 'off',
'jsdoc/require-param': 'off',
'jsdoc/check-tag-names': 'off',
'jsdoc/require-returns': 'off',
'jsdoc/require-property-description': 'off',
'jsdoc/check-param-names': 'off',

// Custom rules from eslint-plugin-node-core
'node-core/no-unescaped-regexp-dot': 'error',
'node-core/no-duplicate-requires': 'error',
Expand All @@ -321,9 +363,12 @@ module.exports = {
BigInt: 'readable',
BigInt64Array: 'readable',
BigUint64Array: 'readable',
Blob: 'readable',
DOMException: 'readable',
Event: 'readable',
EventTarget: 'readable',
MessageChannel: 'readable',
BroadcastChannel: 'readable',
MessageEvent: 'readable',
MessagePort: 'readable',
TextEncoder: 'readable',
Expand All @@ -333,5 +378,6 @@ module.exports = {
btoa: 'readable',
atob: 'readable',
performance: 'readable',
structuredClone: 'readable',
},
};
44 changes: 26 additions & 18 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,17 @@
# 3. PRs touching any code with a codeowner must be signed off by at least one
# person on the code owner team.

# tsc & commcomm
# tsc

/.github/CODEOWNERS @nodejs/tsc
/GOVERNANCE.md @nodejs/tsc
/onboarding.md @nodejs/tsc
/CODE_OF_CONDUCT.md @nodejs/tsc @nodejs/community-committee
/CONTRIBUTING.md @nodejs/tsc @nodejs/community-committee
/LICENSE @nodejs/tsc @nodejs/community-committee
/doc/guides/contributing/code-of-conduct.md @nodejs/tsc @nodejs/community-committee
# TODO(mmarchini): the bot doens't have a notion of precedence, that might
# change when move the codeowners code to an Action, at which point we can
# uncomment the line below
# /doc/guides/contributing/*.md @nodejs/tsc
/doc/guides/contributing/issues.md @nodejs/tsc
/doc/guides/contributing/pull-requests.md @nodejs/tsc
/CODE_OF_CONDUCT.md @nodejs/tsc
/CONTRIBUTING.md @nodejs/tsc
/LICENSE @nodejs/tsc
/doc/guides/contributing/*.md @nodejs/tsc
/doc/guides/collaborator-guide.md @nodejs/tsc
/doc/guides/offboarding.md @nodejs/tsc
/doc/guides/onboarding-extras.md @nodejs/tsc

# streams

Expand Down Expand Up @@ -55,7 +48,7 @@
# tls/crypto

/lib/internal/crypto/* @nodejs/crypto
/lib/internal/tls.js @nodejs/crypto @nodejs/net
/lib/internal/tls/* @nodejs/crypto @nodejs/net
/lib/crypto.js @nodejs/crypto
/lib/tls.js @nodejs/crypto @nodejs/net
/src/node_crypto* @nodejs/crypto
Expand Down Expand Up @@ -91,12 +84,18 @@
/lib/internal/bootstrap/loaders.js @nodejs/modules
/src/module_wrap* @nodejs/modules @nodejs/vm

# N-API
# Node-API

/src/node_api* @nodejs/n-api
/src/js_native_api* @nodejs/n-api
/doc/guides/adding-new-napi-api.md @nodejs/n-api
/doc/api/n-api.md @nodejs/n-api
/src/node_api* @nodejs/node-api
/src/js_native_api* @nodejs/node-api
/doc/guides/adding-new-napi-api.md @nodejs/node-api
/doc/api/n-api.md @nodejs/node-api

# gyp

*.gyp @nodejs/gyp
*.gypi @nodejs/gyp
/tools/gyp/**/* @nodejs/gyp

# WASI
/deps/uvwasi/ @nodejs/wasi
Expand All @@ -115,3 +114,12 @@
/lib/internal/bootstrap/* @nodejs/startup
/tools/code_cache/* @nodejs/startup
/tools/snapshot/* @nodejs/startup

# V8
/deps/v8/* @nodejs/v8-update
/tools/v8_gypfiles/* @nodejs/v8-update

# Actions

/.github/workflows/* @nodejs/actions
/tools/actions/* @nodejs/actions
51 changes: 0 additions & 51 deletions .github/ISSUE_TEMPLATE/1-bug-report.md

This file was deleted.

45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE/1-bug-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: "\U0001F41B Bug report"
description: Create a report to help us improve
body:
- type: markdown
attributes:
value: |
Thank you for reporting an issue.
This issue tracker is for bugs and issues found within Node.js core.
If you require more general support please file an issue on our help repo. https://github.com/nodejs/help
Please fill in as much of the form below as you're able.
- type: input
attributes:
label: Version
description: Output of `node -v`
- type: input
attributes:
label: Platform
description: |
UNIX: output of `uname -a`
Windows: output of `"$([Environment]::OSVersion | ForEach-Object VersionString) $(if ([Environment]::Is64BitOperatingSystem) { "x64" } else { "x86" })"` in PowerShell console
- type: input
attributes:
label: Subsystem
description: If known, please specify affected core module name
- type: textarea
attributes:
label: What steps will reproduce the bug?
description: Enter details about your bug, preferably a simple code snippet that can be run using `node` directly without installing third-party dependencies.
- type: textarea
attributes:
label: How often does it reproduce? Is there a required condition?
- type: textarea
attributes:
label: What is the expected behavior?
description: If possible please provide textual output instead of screenshots.
- type: textarea
attributes:
label: What do you see instead?
description: If possible please provide textual output instead of screenshots.
- type: textarea
attributes:
label: Additional information
description: Tell us anything else you think we should know.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/2-feature-request.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: "\U0001F680 Feature request"
about: Suggest an idea for this project

labels: feature request
---

<!--
Expand Down
34 changes: 0 additions & 34 deletions .github/ISSUE_TEMPLATE/4-report-a-flaky-test.md

This file was deleted.

Loading

0 comments on commit b3265dc

Please sign in to comment.