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

Option to support implied strict (ES6 modules)? #2053

Closed
dead-claudia opened this issue Dec 23, 2014 · 2 comments
Closed

Option to support implied strict (ES6 modules)? #2053

dead-claudia opened this issue Dec 23, 2014 · 2 comments

Comments

@dead-claudia
Copy link

ES6 modules are specified to always be in strict mode, regardless of if there is a "use strict" directive. Every transpiler I've come across, from 6to5 to ES6 Module Transpiler to Traceur all add that statement, without any option to omit it. Something like a boolean impliedstrict could be useful here, as a relaxing option.

The "strict by default" for modules has been in the spec for quite some time, probably a lot longer than the import/export syntax itself.

@dead-claudia
Copy link
Author

The specific section stating this is 10.2.1 of the ECMAScript 6 Draft. The second bullet in the list of that section says, unambiguously:

  • Module code is always strict code.

This is why I believe an option stating that no use strict is necessary, but it should still be parsed as such.

@jugglinmike
Copy link
Member

We just landed gh-2306, so you can expect the module option in the next version of JSHint (>2.7.0).

Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants