-
Notifications
You must be signed in to change notification settings - Fork 119
fix(server):inconsistent use of 'use strict' #2537
Conversation
@@ -1,3 +1,5 @@ | |||
'use strict'; | |||
|
|||
#!/usr/bin/env node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must on the first line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, will do!
the 3 comments I left apply to all changes in other files |
8dd27a8
to
2b75e68
Compare
@vladikoff I think it should be right now. Fixed those newlines up. |
2b75e68
to
6e4a323
Compare
|
||
(function () { | ||
'use strict'; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra spaces / line breaks still left in the diff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was there before I changed anything. You want me to remove those as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add this rule to JSCS http://jscs.info/rule/requirePaddingNewLinesAfterUseStrict.html |
93f0df5
to
4e9e99f
Compare
@vladikoff looks good? |
|
We need to split out JSCS style rules between browser and node.js code. I think the jscs plugin supports extending rules from each other ( just like we have jshintrc files, in root and in app directory) You have 2 options: Option 1.Split this pull request into 2 parts: Option 2.Keep this all as a single PR but you might hit conflicts when you update it due to other pull requests. |
4e9e99f
to
42dddc0
Compare
All node files are throwing errors:
|
From the lint result^ @TDA run |
@TDA Might help if you set |
Ok, looking into that now. |
@vladikoff Should I replace the const with var? or do I have to add the --harmony flag? and if so, where do I add that? |
Also, @vladikoff |
No, let's just disable linting of use strict in server files. Only /app files should be checked for that rule.
We do not support that. |
@TDA let's just have 2 .jscsrc files , one in root, other one in /app |
Follow up from mozilla#2537 Fixed some indentation issues after running JSCS Linter
Follow up from mozilla#2537 Fixed some indentation issues after running JSCS Linter
@vladikoff @pdehaan @zaach This is the entire o/p of running grunt jshint, funnily enough, the jshint tests pass, so I guess the error messages are from the node interpreter, and not from running the jshint linter:
I am assuming the way to fix them is to either move the use strict directives for these 6 files inside function scope, or avoid using const. |
My vote is to probably swap from But I'll leave the whole |
42dddc0
to
3645ab5
Compare
There were the following issues with your Pull Request
Guidelines are available at https://github.com/mozilla/fxa-content-server/blob/master/CONTRIBUTING.md#git-commit-guidelines This message was auto-generated by https://gitcop.com |
3645ab5
to
110f2b7
Compare
There were the following issues with your Pull Request
Guidelines are available at https://github.com/mozilla/fxa-content-server/blob/master/CONTRIBUTING.md#git-commit-guidelines This message was auto-generated by https://gitcop.com |
110f2b7
to
f777b04
Compare
f777b04
to
bf5ee50
Compare
— https://travis-ci.org/mozilla/fxa-content-server/builds/66135872#L547 |
This should be because of the version of JSCS installed, but I did change the dependency to include the latest version of grunt-jscs(1.8.0), which would include the latest jscs(1.13.1) as a sub-dependency. |
I'm not sure what's wrong with this. @vladikoff @shane-tomlinson @zaach Is there an easy way to see what versions of the modules that Travis has installed/cached, or should we add |
@pdehaan - I just went into travis and deleted the cache for the branch, if that doesn't fix the problem, I'll kill all caches. |
bf5ee50
to
a54b4e1
Compare
@TDA I see that the Travis build is re-re-re-starting. If this build doesn't pass, maybe try putting this change in the .travis.yml file so we can see exactly which modules+versions are getting installed on Travis: https://github.com/mozilla/fxa-content-server/pull/2564/files |
@vladikoff @shane-tomlinson Travis seems to be barfing all over the place this morning. Not sure why this PR's travis log is showing stuff like this during
|
Fixes mozilla#1318 Fix files that use 'use strict' in function scope. Put 'use strict' directives in the global scope. Fix spacing and newline issues.
a54b4e1
to
cc88e84
Compare
@pdehaan Doing this now :) |
@TDA: Actually, this build may pass. DON'T TOUCH ANYTHING! 🤞 |
@pdehaan :O :O I added the - npm ls --depth 0 to the travis file, should I remove it? |
@pdehaan What dark magic is this, master? |
I think Travis is just having some issues today. Let's just cross our fingers that we can get this merged before we hit merge conflicts or have to do any more pushes. 😓 |
Fair enough. Looks like its merged now 💃 |
Fixes #1318
This fixes the files that use 'use strict' inside function scope and puts all the 'use strict' directives in the global scope.
This excludes files in the following directories:
.tmp
node_modules
app/bower_components
app/scripts/vendor
dist
@zaach