Reputation: 2051
Assume if I'm working with Sails.JS
let's call it Sails and using Brackets IDE that implement JsHint as code validator. Is there any best practices how to validate
Sails's services
and models
? Not ignoring them.
Because by default, JsHint force (actually it is help) us to define variable before we use them, even global variable. I don't know why, if I define my models
like var model = sails.models.model
or var Model = global.Model
for example, the application got an error instead.
I want to implement JsHint as neat as possible, because I'm working in team that still don't have any code standard guideline.
Upvotes: 4
Views: 987
Reputation: 5979
If you check out JShint docs, it will tell you how to define your global variables in an config file or at the top of your script so that it will ignore them.
Add to the top of your .js file
/*global sails*/
Look under the section globals
Upvotes: 4