Skip to content
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

strict mode #287

Closed
sonnyp opened this issue Oct 9, 2015 · 4 comments

Comments

@sonnyp
Copy link
Contributor

commented Oct 9, 2015

Couldn't find a discussion on the topic.

What's the logic behind not enforcing strict mode in standard?

@dcousens dcousens added the question label Oct 9, 2015

@marvinroger

This comment has been minimized.

Copy link

commented Oct 10, 2015

Knowing that Node ^4.0.0 requires strict mode to be able to use the new ES6 let, const keywords, function-in-blocks and classes.

@rstacruz

This comment has been minimized.

Copy link
Member

commented Oct 11, 2015

My guess is so that you can check for snippets of a file, but I don't know enough about the project's history to make an authoritative comment.

@yoshuawuyts

This comment has been minimized.

Copy link
Contributor

commented Oct 11, 2015

standard already warns for strict-mode incompatible syntax. ES6 already has strict mode enabled by default. I think that between the two, enforcing the "strict mode" pragma at the top of every file should be left up to the authors.

Also: enforcing the pragma would break a ton of packages using standard.

@feross

This comment has been minimized.

Copy link
Member

commented Feb 4, 2016

Right, what @yoshuawuyts said.

standard already assumes that your code is running in an ES6 environment, so you'll warnings for things that are strict-mode incompatible. But enforcing "use strict" is going too far, since it doesn't meaningfully change the way code runs for the vast majority of standard users.

If you need node support, just add "use strict" to your files.

@feross feross closed this Feb 4, 2016

@fibo fibo referenced this issue Feb 12, 2016

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
6 participants
You can’t perform that action at this time.