fix(sandbox): switch alwaysStrict default to false#3019
Closed
JoshuaKGoldberg wants to merge 1 commit intomicrosoft:v2from
Closed
fix(sandbox): switch alwaysStrict default to false#3019JoshuaKGoldberg wants to merge 1 commit intomicrosoft:v2from
JoshuaKGoldberg wants to merge 1 commit intomicrosoft:v2from
Conversation
orta
approved these changes
Feb 1, 2024
Member
|
I am still not entirely convinced that this is a good idea, but, in what conditions do we currently actually emit it? The default settings on the playground don't show |
Contributor
Author
|
If the current file is a script (rather than a module). https://www.typescriptlang.org/play?#code/Q: |
Member
|
Ah, I had some stuff sitting in my browser. |
Member
|
Per microsoft/TypeScript#62213, we're going in the opposite direction on this such that all code will be forcibly strict (and get this prologue if not ESM). I think better would be to modernize the playground's options to not target CJS. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Per my interpretation of a brief discussion on
alwaysStrictin Discord, changes the default value for that setting to off.Note that this doesn't imply anything about TypeScript's recommendations around strict mode. It just changes the playground to not emit a
"use strict";on top of emitted JS. That string has been a thorn in my side trying to teach TypeScript in workshops for years.