Skip to content

fix(sandbox): switch alwaysStrict default to false #3019

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: v2
Choose a base branch
from

Conversation

JoshuaKGoldberg
Copy link
Contributor

Per my interpretation of a brief discussion on alwaysStrict in 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.

@jakebailey
Copy link
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 "use strict"; in the JS output.

@JoshuaKGoldberg
Copy link
Contributor Author

If the current file is a script (rather than a module). https://www.typescriptlang.org/play?#code/Q:

Screenshot of the TypeScript playground with no input code. The output is "use strict";

@jakebailey
Copy link
Member

Ah, I had some stuff sitting in my browser.

@jakebailey jakebailey added the deploy-preview Enables automatic deployments to preview environments on a PR label Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy-preview Enables automatic deployments to preview environments on a PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants