Permalink
Browse files

lint fixes

  • Loading branch information...
1 parent 33e7d80 commit 5cb4e9fd46c6d9be1bd14a374d1d0fd35c435f41 @puzrin puzrin committed Feb 16, 2013
View
@@ -2,20 +2,26 @@
// Enforcing Options /////////////////////////////////////////////////////////
"bitwise" : true, // Prohibit bitwise operators (&, |, ^, etc.).
+ "camelcase" : false, // Require variable names to be camelCase style or UPPER_CASE
"curly" : true, // Require {} for every new block or scope.
"eqeqeq" : true, // Require triple equals i.e. `===`.
"forin" : false, // Tolerate `for in` loops without `hasOwnPrototype`.
"immed" : true, // Require immediate invocations to be wrapped in parens e.g. `( function(){}() );`
+ "indent" : 2, // This option enforces specific tab width for your code
"latedef" : true, // Prohibit hariable use before definition.
"newcap" : true, // Require capitalization of all constructor functions e.g. `new F()`.
"noarg" : true, // Prohibit use of `arguments.caller` and `arguments.callee`.
"noempty" : true, // Prohibit use of empty blocks.
"nonew" : true, // Prohibit use of constructors for side-effects.
- "plusplus" : true, // Prohibit use of `++` & `--`.
+ "plusplus" : false, // Prohibit use of `++` & `--`.
+ "quotmark" : false, // Enforces the consistency of quotation marks used throughout your code.
"regexp" : false, // Prohibit `.` and `[^...]` in regular expressions.
"undef" : true, // Require all non-global variables be declared before they are used.
+ "unused" : true, // This option warns when you define and never use your variables.
"strict" : true, // Require `use strict` pragma in every file.
"trailing" : true, // Prohibit trailing whitespaces.
+ "maxstatements" : false, // Enforce max amount of statements per function
+ "maxcomplexity" : false, // Enforce cyclomatic complexity level
// Relaxing Options //////////////////////////////////////////////////////////
@@ -32,6 +38,7 @@
"iterator" : false, // Allow usage of __iterator__ property.
"lastsemic" : false, // Tolerate semicolon omited for the last statement.
"laxbreak" : false, // Tolerate unsafe line breaks e.g. `return [\n] x` without semicolons.
+ "laxcomma" : true, // This option suppresses warnings about comma-first coding style
"loopfunc" : false, // Allow functions to be defined within loops.
"multistr" : false, // Tolerate multi-line strings.
"onecase" : false, // Tolerate swithes with only one case.
@@ -55,6 +62,7 @@
"nonstandard" : false, // Defines non-standard but widely adopted globals such as escape and unescape
"prototypejs" : false, // Defines globals exposed by the Prototype
"rhino" : false, // Defines globals exposed when running under Rhino
+ "worker" : false, // Defines globals exposed when running Web Worker
"wsh" : false, // Defines globals exposed when running under WSH
// Legacy ////////////////////////////////////////////////////////////////////
@@ -64,8 +72,7 @@
"passfail" : false, // Stop on first error.
"white" : false, // Check against strict whitespace and indentation rules.
- // Undocumented //////////////////////////////////////////////////////////////
+ // Other /////////////////////////////////////////////////////////////////////
- "maxerr" : 100, // Maximum error before stopping.
- "indent" : 2 // Specify indentation spacing
+ "maxerr" : 100 // Maximum error before stopping.
}
View
@@ -7,7 +7,6 @@
// stdlib
var fs = require('fs');
var path = require('path');
-var exec = require('child_process').exec;
// 3rd-party
@@ -23,12 +22,12 @@ var template = require('../lib/ndoc/common').template;
function exit(err) {
- if (err) {
- console.error(err.message || err);
- process.exit(1);
- }
+ if (err) {
+ console.error(err.message || err);
+ process.exit(1);
+ }
- process.exit(0);
+ process.exit(0);
}
View
@@ -218,7 +218,7 @@ function build_tree(nodes, options) {
// assign aliases, subclasses, constructors
// correct method types (class or entity)
- _.each(nodes, function (node, id) {
+ _.each(nodes, function (node /*, id*/) {
// aliases
if (node.alias_of && nodes[node.alias_of]) {
nodes[node.alias_of].aliases.push(node.id);
View
@@ -43,7 +43,6 @@
// stdlib
var fs = require('fs');
-var path = require('path');
// 3rd-party
@@ -64,7 +63,7 @@ var renderers = require('./renderers');
var cli = module.exports = new ArgumentParser({
version: require('./version'),
addHelp: true,
- formatterClass: function(options) {
+ formatterClass: function (options) {
options['maxHelpPosition'] = 40;
return new argparse.HelpFormatter(options);
}
@@ -21,6 +21,6 @@ var LazyChoices = module.exports = function LazyChoices(options) {
require('util').inherits(LazyChoices, Action);
-LazyChoices.prototype.call = function (parser, namespace, values, optionString) {
+LazyChoices.prototype.call = function (parser, namespace, values) {
namespace.set(this.dest, values);
};
@@ -23,6 +23,6 @@ var ReadFile = module.exports = function ReadFile(options) {
require('util').inherits(ReadFile, Action);
-ReadFile.prototype.call = function (parser, namespace, values, optionString) {
+ReadFile.prototype.call = function (parser, namespace, values) {
namespace.set(this.dest, fs.readFileSync(values.shift(), 'utf8'));
};
@@ -23,7 +23,7 @@ var ReadJSON = module.exports = function ReadJSON(options) {
require('util').inherits(ReadJSON, Action);
-ReadJSON.prototype.call = function (parser, namespace, values, optionString) {
+ReadJSON.prototype.call = function (parser, namespace, values) {
var str = fs.readFileSync(values.shift(), 'utf8');
namespace.set(this.dest, JSON.parse(str));
};
@@ -32,7 +32,7 @@ var parser = require('./javascript/parser');
function parse_javascript(file, options, callback) {
fs.readFile(file, 'utf8', function (err, source) {
- var nodes, list = {}, tree, parted, sections, children;
+ var nodes, list = {};
if (err) {
callback(err);
@@ -50,7 +50,7 @@ function parse_javascript(file, options, callback) {
}
// do pre-distribute early work
- _.each(nodes, function (node, id) {
+ _.each(nodes, function (node /*, id*/) {
var clone;
// assign hierarchy helpers
@@ -49,7 +49,7 @@ var template = require('../../common').template;
// Markdown highlighter callback function
-var marked_highlight = function(code, lang) {
+var marked_highlight = function (code, lang) {
if (lang) {
return hljs.highlight(lang, code).value;
} else {
@@ -165,7 +165,7 @@ function render_html(ndoc, options, callback) {
var r = obj.id;
if (sig.args) {
r += '(';
- sig.args.forEach(function (arg, idx, args) {
+ sig.args.forEach(function (arg, idx) {
var skip_first, a, value;
// skip the first bound argument for prototype methods
skip_first = obj.bound && obj.id.indexOf('#') >= 0;

0 comments on commit 5cb4e9f

Please sign in to comment.