-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 compiler option to parse in strict mode #10758
Comments
Hi,
If this is integrated directly into the TS repo, we could abandon the fork and use the original TS Services lib instead. Thank you! |
👍 I would really like to see |
Accepting PRs for a new flag/setting
@T18970237136 perhaps you could turn your fork into a PR? |
Note, that a feature request for the same behavior (compiler option that parses in strict mode and also emits
@RyanCavanaugh Note that my fork currently only implements the first part: parse source files in strict mode. It does not affect the emit, so it will not emit |
* add compiler option alwaysStrict * compile in strict mode when option is set * emit "use strict"
* add unit test to ensure "use strict" is not added twice * fix code
* fix comment * optimize loop
thanks @slawomir! |
The new option is |
See #9449 and #10755 for reference.
The ts code base is not modules, so it is not implicitly parsed in strict mode. we would like it to be. options either 1. put "use strict" at the top of every file, and make the emitter remove the duplicate ones when it merges the output. or 2. add a compiler flag that would force the compiler to parse the files in strict mode.
The text was updated successfully, but these errors were encountered: