Work with Sails.JS and JsHint

Suppose I work with Sails.JSto call it Sails and use the middle bracket construct that implements JsHint as a means of checking code. Are there any recommendations for validateSails servicesand models? Without ignoring them.

Because, by default, JsHint force (actually this is help) we need to define a variable before we use them, even a global variable. I do not know why, if I define my own models, for example, var model = sails.models.modelor var Model = global.Model, for example, the application received an error instead.

I want to implement JsHint as carefully as possible, because I work in a team that still does not have a standard code standard.

+4
source share
1 answer

If you look at JShint docs, it will tell you how to define your global variables in the configuration file or at the top of your script so that it ignores them.

http://www.jshint.com/docs/

Add to top of your .js file

/*global sails*/

Look under the globules section

+4
source

All Articles