In our angularjs project, after up-gradation of gulp3 to 4 and when i run : gulp lint
C:\filepath>gulp lint
[12:59:30] Using gulpfile ~\filepath\gulpfile.js
[12:59:30] Starting 'lint'...
app\js\app.config.js: line 4, col 1, Use the function form of "use strict".
1 error
Illegal space before opening round brace at C:\filepath\app\js\app.config.js :
7 |angular
8 | .module('test')
9 | .config(['localStorageServiceProvider', function (localStorageServiceProvider) {
C:\filepath>gulp lint
[12:59:30] Using gulpfile ~\filepath\gulpfile.js
[12:59:30] Starting 'lint'...
app\js\app.config.js: line 4, col 1, Use the function form of "use strict".
1 error
Illegal space before opening round brace at C:\filepath\app\js\app.config.js :
7 |angular
8 | .module('test')
9 | .config(['localStorageServiceProvider', function (localStorageServiceProvider) {
I am not able to figure out, everything was working fine earlier. Only after the gulp upgradation to latest one, build is failing. Can anybody please assist me with this.
I also followed this link : How can I suppress the JSHint "JSCS: Illegal Space" warnings in Visual Studio 2013?.
According to the link above, i tried adding below lines inside .jshintrc file:
"requireSpacesInAnonymousFunctionExpression": {
"beforeOpeningCurlyBrace": false
},
"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": false
},
"disallowSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": false
}
Its throwing more error following the previous:
6 code style errors found.
app\js\app.module.js: line 0, col 0, Bad option: 'requireSpacesInAnonymousFunctionExpression'.
app\js\app.module.js: line 0, col 0, Bad option: 'disallowSpacesInNamedFunctionExpression'.
app\js\app.module.js: line 0, col 0, Bad option: 'disallowSpacesInFunctionDeclaration'.
app\js\app.module.js: line 4, col 1, Use the function form of "use strict".
What i require here is:
My Editor webstorm automatically applying space for alignments as mentioned below:
function (localStorageServiceProvider) // with space
But, it should be:
function(localStorageServiceProvider) // without space
What is the exact rule i need to apply in .jshintrc file or any other places which fixes...?