Skip to content

src: unflag --experimental-default-config-file #58703

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
32 changes: 18 additions & 14 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -980,20 +980,6 @@ unknown keys or keys that cannot be used in a namespace.
Node.js will not sanitize or perform validation on the user-provided configuration,
so **NEVER** use untrusted configuration files.

### `--experimental-default-config-file`

<!-- YAML
added:
- v23.10.0
- v22.16.0
-->

> Stability: 1.0 - Early development

If the `--experimental-default-config-file` flag is present, Node.js will look for a
`node.config.json` file in the current working directory and load it as a
as configuration file.

### `--experimental-eventsource`

<!-- YAML
Expand Down Expand Up @@ -1720,6 +1706,24 @@ added: v0.8.0

Silence deprecation warnings.

### `--no-experimental-default-config-file`

<!-- YAML
added:
- v23.10.0
- v22.16.0
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/58703
description: This flag is now enabled by default.
-->

> Stability: 1.0 - Early development

Unless `--no-experimental-default-config-file` flag is present, Node.js will look for a
`node.config.json` file in the current working directory and load it as a
as configuration file.

### `--no-experimental-detect-module`

<!-- YAML
Expand Down
6 changes: 3 additions & 3 deletions doc/node.1
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,6 @@ Enable experimental addon module support.
.It Fl -experimental-config-file
Specifies the configuration file to load.
.
.It Fl -experimental-default-config-file
Enable support for automatically loading node.config.json.
.
.It Fl -experimental-import-meta-resolve
Enable experimental ES modules support for import.meta.resolve().
.
Expand All @@ -198,6 +195,9 @@ Enable transformation of TypeScript-only syntax into JavaScript code.
.It Fl -experimental-eventsource
Enable experimental support for the EventSource Web API.
.
.It Fl -no-experimental-default-config-file
Disables support for automatically loading node.config.json.
.
.It Fl -no-experimental-websocket
Disable experimental support for the WebSocket API.
.
Expand Down
3 changes: 1 addition & 2 deletions lib/internal/process/pre_execution.js
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,7 @@ function setupSQLite() {
}

function initializeConfigFileSupport() {
if (getOptionValue('--experimental-default-config-file') ||
getOptionValue('--experimental-config-file')) {
if (getOptionValue('--experimental-config-file')) {
emitExperimentalWarning('--experimental-config-file');
}
}
Expand Down
1 change: 0 additions & 1 deletion lib/internal/test_runner/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ const kFilterArgs = [
'--test',
'--experimental-test-coverage',
'--watch',
'--experimental-default-config-file',
'--experimental-config-file',
];
const kFilterArgValues = ['--test-reporter', '--test-reporter-destination'];
Expand Down
4 changes: 3 additions & 1 deletion src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,9 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
&EnvironmentOptions::experimental_config_file_path);
AddOption("--experimental-default-config-file",
"set config file from default config file",
&EnvironmentOptions::experimental_default_config_file);
&EnvironmentOptions::experimental_default_config_file,
kDisallowedInEnvvar,
true);
AddOption("--test",
"launch test runner on startup",
&EnvironmentOptions::test_runner,
Expand Down
2 changes: 1 addition & 1 deletion src/node_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ class EnvironmentOptions : public Options {
bool report_exclude_env = false;
bool report_exclude_network = false;
std::string experimental_config_file_path;
bool experimental_default_config_file = false;
bool experimental_default_config_file = true;

inline DebugOptions* get_debug_options() { return &debug_options_; }
inline const DebugOptions& debug_options() const { return debug_options_; }
Expand Down
Loading