javascript - How configure jshint in a meanjs project with socket.io? -


i followed that tutorial (i replaced vexxhost domain name localhost:3000 tests).

and while calling grunt there error ('io' not defined) server start without other complain.

if correctly understood problem, jshint scan whole project validate code , finds on reference undefined variable ! 'io' defined when whole application starts (because script loaded). in fact, error more warning error

if right (and hope people here correct me if not), bring question : how refactor code or configure jshint avoid warning ?

if possible prefer have explicit reference 'io'.

by advance thank everyone.

edit

my results tutorial available here on github. problematic file public/modules/core/services/socket.js.

there 2 way configure jshint correct error :

  • if calling io variable in several place of code. jshint configurable in .jshintrc file, there a global section possible add "io": true. modification, jshint should consider io global variable.

  • or if call io variable once, can add comment /* global io: true */ directly in file calling it.


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -