I get several recommendations to compile a maximum of 80 characters when writing javascript, e.g. Google, NPM, Node. JS, Crockford In some cases, though, I do not think how best to do this. MongoClient.connect ('mongodb: // localhost: 27017 / sampleDatabase', function (mistake, database) {if (err)} {throw error;} db = database;}); This will throw a jshint warning because it exceeds 80 characters. Now, do you choose to ignore the warning in this example, or instead choose an option for a solution like MongoClient.connect ('mongodb: // localhost: 27017 / sampleDatabase' , Function (err, database) {if (err) {throw error;} db = database;}); If you can reuse the url variable So, great option if this is a shot, as is often such a call, I would probably do something like this ... / * jslint sloppy: true, white: true, browser: True, maxlen: 80 * / / * global mongo client * / var dbarhh, db; DbErrHand = function (mistake, database) {if (err) {throw error; } ...
Comments
Post a Comment