fix(server):inconsistent use of 'use strict' #2537
Conversation
| @@ -1,3 +1,5 @@ | |||
| 'use strict'; | |||
|
|
|||
| #!/usr/bin/env node | |||
vladikoff
Jun 5, 2015
Contributor
This must on the first line
This must on the first line
TDA
Jun 5, 2015
Author
Contributor
Oops, will do!
Oops, will do!
| @@ -13,7 +15,7 @@ | |||
| // use this if you want to recursively match all subfolders: | |||
| // 'test/spec/**/*.js' | |||
| module.exports = function (grunt) { | |||
| 'use strict'; | |||
|
|
|||
vladikoff
Jun 5, 2015
Contributor
All the extra space in here and other files below need to be removed
All the extra space in here and other files below need to be removed
TDA
Jun 5, 2015
Author
Contributor
ok will do!
ok will do!
| @@ -1,10 +1,11 @@ | |||
| 'use strict'; | |||
|
|
|||
| /* This Source Code Form is subject to the terms of the Mozilla Public | |||
vladikoff
Jun 5, 2015
Contributor
the copyright must be first.
the copyright must be first.
|
the 3 comments I left apply to all changes in other files |
8dd27a8
to
2b75e68
|
@vladikoff I think it should be right now. Fixed those newlines up. |
|
|
||
| (function () { | ||
| 'use strict'; | ||
|
|
||
|
|
vladikoff
Jun 7, 2015
Contributor
extra spaces / line breaks still left in the diff
extra spaces / line breaks still left in the diff
TDA
Jun 7, 2015
Author
Contributor
It was there before I changed anything. You want me to remove those as well?
It was there before I changed anything. You want me to remove those as well?
| define([ | ||
| 'sjcl', | ||
| 'lib/promise' | ||
| ], | ||
| function (sjcl, p) { | ||
| 'use strict'; | ||
|
|
||
|
|
|
Please add this rule to JSCS http://jscs.info/rule/requirePaddingNewLinesAfterUseStrict.html |
93f0df5
to
4e9e99f
|
@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. |
|
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 |
|
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 |
|
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 |
— 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. |
|
@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 #1318 Fix files that use 'use strict' in function scope. Put 'use strict' directives in the global scope. Fix spacing and newline issues.
|
@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