Without looking at the code it's hard to decide whether there is a way to write the code which will prevent the error, but one solution is that you can put in your file:
// jshint unused:false
Which will disable that check for the file.
Another option might be to tell jshint that you are exporting that variable (though I am not sure if this is exactly correct from your description), with:
/* exported selectcourses*/
See jshint docs for more details