-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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
Removed eslint rule that checks modules #6403
Conversation
After we updated to ESLint 2.x, ESLint started complaining "'use strict' is unnecessary inside of modules strict". This is correct behaviour because according to spec modules are strict. The problem is that our transforms don't transpile strict mode so we still need to have this pragma in all our code. I did not find a way to make eslint require "use strict" for ES6 modules: eslint/eslint#2785 So I am removing this. What stops us from automatically adding strict mode with babel?
By analyzing the blame information on this pull request, we identified @frantic, @spicyj and @ericvicenti to be potential reviewers. |
@bestander updated the pull request. |
Related: #5796 |
I agree with @janicduplessis, as long as we keep the code consistent it should be easy to write a codemod. cc @vjeux, do you remember why we opted into using |
I do not know why we don't automatically insert use strict in es6 modules. |
When providesModule was introduced, there was some code that relied on CommonJS semantics which led to two things: 'use strict' was not enforced and people could write code that was valid inside of a function but not a module's top-level scope. That said to my knowledge FB is still on |
@facebook-github-bot shipit |
Thanks for importing. If you are an FB employee go to Phabricator to review. |
Removed eslint rule that checks modules
After we updated to ESLint 2.x, ESLint started complaining
'use strict' is unnecessary inside of modules strict
.This is correct behaviour because according to spec modules are strict.
The problem is that our transforms don't transpile strict mode so we still need to have this pragma in all our code.
I did not find a way to make eslint require "use strict" for ES6 modules: eslint/eslint#2785
So I am removing this.
What stops us from automatically adding strict mode with babel?
Need your feedback, @frantic @martinbigio
David said that you Martin looked into this.