-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Add flag to emit modules in loose mode #6884
Conversation
@@ -320,6 +320,11 @@ namespace ts { | |||
name: "allowSyntheticDefaultImports", | |||
type: "boolean", | |||
description: Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking | |||
}, | |||
{ | |||
name: "emitModulesInLooseMode", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about emitNonStrictModules
. "Loose mode" isn't a formally described thing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to avoid the double negative
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Coming from babel, "loose mode" means a set of operations are allowed to be performed not-to-spec (so that some corner cases don't function as expected) - TS output (by comparison) is always loose mode.
What about omitUseStrictPrologue
or simply omitUseStrict
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, "loose" would be confusing.
I don't see a double negation with emitNonStrictModules
, but Wesley's suggestions are good as well.
@@ -320,6 +320,11 @@ namespace ts { | |||
name: "allowSyntheticDefaultImports", | |||
type: "boolean", | |||
description: Diagnostics.Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking | |||
}, | |||
{ | |||
name: "emitNonStrictModules", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noAutomaticUseStrict or implictUseStrictOnly to accommodate for classes.
👍 |
Add flag to emit modules in loose mode
Fix for #6819, adds a new flag
--emitModulesInLooseMode
to not emit"use strict"
prologue in modules.