Skip to content

Commit a3510b1

Browse files
committed
fixup: remove -m
1 parent 484d1fb commit a3510b1

File tree

5 files changed

+3
-17
lines changed

5 files changed

+3
-17
lines changed

doc/api/esm.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,16 @@ node --experimental-modules my-app.mjs
4747

4848
Files ending with `.js` or `.mjs`, or lacking any extension,
4949
will be loaded as ES modules when the `--type=module` flag is set.
50-
This flag also has a shorthand alias `-m`.
5150

5251
```sh
5352
node --experimental-modules --type=module my-app.js
54-
# or
55-
node --experimental-modules -m my-app.js
5653
```
5754

5855
For completeness there is also `--type=commonjs`, for explicitly running a `.js`
59-
file as CommonJS. This is the default behavior if `--type` or `-m` is
56+
file as CommonJS. This is the default behavior if `--type` is
6057
unspecified.
6158

62-
The `--type=module` or `-m` flags can also be used to configure Node.js to treat
59+
The `--type=module` flag can also be used to configure Node.js to treat
6360
as an ES module input sent in via `--eval` or `--print` (or `-e` or `-p`) or
6461
piped to Node.js via `STDIN`.
6562

lib/internal/errors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ E('ERR_TRANSFORM_WITH_LENGTH_0',
958958
E('ERR_TTY_INIT_FAILED', 'TTY initialization failed', SystemError);
959959
E('ERR_TYPE_MISMATCH', (filename, ext, typeFlag, conflict) => {
960960
const typeString =
961-
typeFlag === 'module' ? '--type=module or -m' : '--type=commonjs';
961+
typeFlag === 'module' ? '--type=module' : '--type=commonjs';
962962
// --type mismatches file extension
963963
if (conflict === 'extension')
964964
return `Extension ${ext} is not supported for ` +

src/node_options.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
336336
"top-level module type name",
337337
&EnvironmentOptions::module_type,
338338
kAllowedInEnvironment);
339-
AddAlias("-m", { "--type", "module" });
340339

341340
AddOption("--check",
342341
"syntax check script without executing",

test/es-module/test-esm-type-flag-alias.mjs

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

test/es-module/test-esm-type-flag-errors.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,14 @@ expect('', packageWithoutTypeMain, 'package-without-type');
2222
// Check that running with --type and no package.json "type" works
2323
expect('--type=commonjs', packageWithoutTypeMain, 'package-without-type');
2424
expect('--type=module', packageWithoutTypeMain, 'package-without-type');
25-
expect('-m', packageWithoutTypeMain, 'package-without-type');
2625

2726
// Check that running with conflicting --type flags throws errors
2827
expect('--type=commonjs', mjsFile, 'ERR_TYPE_MISMATCH', true);
2928
expect('--type=module', cjsFile, 'ERR_TYPE_MISMATCH', true);
30-
expect('-m', cjsFile, 'ERR_TYPE_MISMATCH', true);
3129
expect('--type=commonjs', packageTypeModuleMain,
3230
'ERR_TYPE_MISMATCH', true);
3331
expect('--type=module', packageTypeCommonJsMain,
3432
'ERR_TYPE_MISMATCH', true);
35-
expect('-m', packageTypeCommonJsMain,
36-
'ERR_TYPE_MISMATCH', true);
3733

3834
function expect(opt = '', inputFile, want, wantsError = false) {
3935
// TODO: Remove when --experimental-modules is unflagged

0 commit comments

Comments
 (0)