You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 29, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Jul 29, 2026. It is now read-only.
'grunt jshint:server' ignores deep server/api files #463
And my apologies - missed two latedef errors. The full set of problems pre changes to jshintrc are below.
Re overrides: Completely agree but since the grunt jshint:server mixes specs and api files, it was the quickest solution to add /*jshint expr:true */ to the specs. Perhaps it is worth a separate grunt task for server specs requiring a new .jshintrc.
server/api/thing/thing.controller.js
line 66 col 21 'handleError' was used before it was defined.
server/api/thing/thing.socket.js
line 18 col 16 'onSave' was used before it was defined.
line 22 col 18 'onRemove' was used before it was defined.
server/api/thing/thing.spec.js
line 7 col 1 'describe' is not defined.
line 9 col 3 'it' is not defined.
server/api/user/user.model.spec.js
line 54 col 45 Expected an assignment or function call and instead saw an expression.
line 58 col 45 Expected an assignment or function call and instead saw an expression.
line 14 col 1 'describe' is not defined.
line 15 col 3 'before' is not defined.
line 22 col 3 'afterEach' is not defined.
line 28 col 3 'it' is not defined.
line 35 col 3 'it' is not defined.
line 45 col 3 'it' is not defined.
line 53 col 3 'it' is not defined.
line 57 col 3 'it' is not defined.
@bkapicka I think I see what you're saying. As in, it would not be advised to define describe, before, afterEach, it... as globals for non-spec files, to which I would agree.
I agree with @bkapicka's points, but I don't think latedef should be removed from the .jshintrc. I think a PR to fix these issues would be great guys, thanks!
@JaKXz I totally miss understood @bkapicka first point. I thought he was suggesting that we ADD latedef not remove it. I was under the impression it was NOT in the server .jshint. But I see now.
Activity
kingcody commentedon Aug 20, 2014
I agree with 2, but do you know the files/line numbers for the
latedefissue?bkapicka commentedon Aug 20, 2014
@kingcody
Server .jshintrc template file link
File Path: generator-angular-fullstack / app / templates / server / .jshintrc
Line Number: L7.
kingcody commentedon Aug 20, 2014
@bkapicka, sorry I actually meant: what were the offending files? The ones that had late definitions.
bkapicka commentedon Aug 20, 2014
@kingcody my mistake - it was line 87 of the template thing.controller.js:
output from generated app:
kingcody commentedon Aug 20, 2014
Ok, great. I'll see about getting a PR together to address that. Were there any other files that did not pass?
Btw; it's my 'opinion' that the less overrides in the linter the better, barring globals. Just my opinion though
bkapicka commentedon Aug 20, 2014
Thanks for the PR.
And my apologies - missed two latedef errors. The full set of problems pre changes to jshintrc are below.
Re overrides: Completely agree but since the
grunt jshint:servermixes specs and api files, it was the quickest solution to add/*jshint expr:true */to the specs. Perhaps it is worth a separate grunt task for server specs requiring a new .jshintrc.kingcody commentedon Aug 20, 2014
@bkapicka I think I see what you're saying. As in, it would not be advised to define
describe, before, afterEach, it...as globals for non-spec files, to which I would agree.@DaftMonk, @JaKXz any thoughts on this subject?
JaKXz commentedon Aug 21, 2014
I agree with @bkapicka's points, but I don't think
latedefshould be removed from the.jshintrc. I think a PR to fix these issues would be great guys, thanks!kingcody commentedon Aug 21, 2014
@JaKXz I totally miss understood @bkapicka first point. I thought he was suggesting that we ADD
latedefnot remove it. I was under the impression it was NOT in the server .jshint. But I see now.DaftMonk commentedon Aug 21, 2014
I wouldn't mind getting rid of
latedef. Those functions are hoisted, so there shouldn't be any issues with it.It makes sense to me to have the public api of a module closer to the top for easier scanning of a file, and private methods near the bottom.
kingcody commentedon Aug 21, 2014
@DaftMonk should we look at using
latedef: nofunc? Just noticed it was an option. Not sure if that would be a good middle ground?DaftMonk commentedon Aug 21, 2014
@kingcody Nice find! That sounds perfect.