diff --git a/.eslintrc b/.eslintrc index c26dca1bc..592cbfc0c 100644 --- a/.eslintrc +++ b/.eslintrc @@ -48,7 +48,6 @@ "no-caller": 2, "no-div-regex": 2, "no-else-return": 0, - "no-empty-label": 2, "no-eq-null": 2, "no-eval": 2, "no-extra-bind": 2, @@ -156,12 +155,11 @@ "semi": [2, "always"], "semi-spacing": 2, "sort-vars": 0, - "space-after-keywords": [2, "always"], + "keyword-spacing": 2, "space-before-blocks": [2, "always"], "space-in-brackets": 0, // TODO: enable? "space-in-parens": 0, // TODO: enable? "space-infix-ops": 2, - "space-return-throw-case": 2, "space-unary-ops": 2, "spaced-comment": [2, "always"], "wrap-regex": 0, diff --git a/gulpfile.js b/gulpfile.js index b4800b4ac..4fb23b48d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -48,7 +48,7 @@ gulp.task('coverage', function(cb) { }); gulp.task('lint', function() { - var pipeline = gulp.src(options.lintPaths) + return gulp.src(options.lintPaths) .pipe(eslint()) .pipe(eslint.formatEach()) .pipe(eslint.failOnError()); diff --git a/lib/jsdoc/opts/args.js b/lib/jsdoc/opts/args.js index 6daa8542e..8c2127753 100644 --- a/lib/jsdoc/opts/args.js +++ b/lib/jsdoc/opts/args.js @@ -86,4 +86,5 @@ exports.get = function(name) { else if ( hasOwnProp.call(ourOptions, name) ) { return ourOptions[name]; } + return undefined; }; diff --git a/lib/jsdoc/src/astnode.js b/lib/jsdoc/src/astnode.js index 888a2c76b..488e98446 100644 --- a/lib/jsdoc/src/astnode.js +++ b/lib/jsdoc/src/astnode.js @@ -363,6 +363,7 @@ var getInfo = exports.getInfo = function(node) { info.paramnames = getParamNames(definition.value); return true; } + return false; }); break; diff --git a/lib/jsdoc/src/handlers.js b/lib/jsdoc/src/handlers.js index 13cb3b215..791581f98 100644 --- a/lib/jsdoc/src/handlers.js +++ b/lib/jsdoc/src/handlers.js @@ -299,6 +299,8 @@ function newSymbolDoclet(parser, docletSrc, e) { addDoclet(parser, newDoclet); e.doclet = newDoclet; + + return true; } /** diff --git a/lib/jsdoc/src/parser.js b/lib/jsdoc/src/parser.js index 51c77a7bb..73df00351 100644 --- a/lib/jsdoc/src/parser.js +++ b/lib/jsdoc/src/parser.js @@ -319,6 +319,7 @@ Parser.prototype.getBasename = function(name) { if (name !== undefined) { return name.replace(/^([$a-z_][$a-z_0-9]*).*?$/i, '$1'); } + return undefined; }; // TODO: docs diff --git a/lib/jsdoc/src/visitor.js b/lib/jsdoc/src/visitor.js index 3b82a979f..30aa547b5 100644 --- a/lib/jsdoc/src/visitor.js +++ b/lib/jsdoc/src/visitor.js @@ -132,6 +132,7 @@ function findRestParam(params) { restParam = param; return true; } + return false; }); return restParam; diff --git a/lib/jsdoc/tag/dictionary/definitions.js b/lib/jsdoc/tag/dictionary/definitions.js index 6e0ffd1e7..2bd71c4a1 100644 --- a/lib/jsdoc/tag/dictionary/definitions.js +++ b/lib/jsdoc/tag/dictionary/definitions.js @@ -175,6 +175,7 @@ function parseBorrows(doclet, tag) { else if (m[1]) { return { target: m[1] }; } + return {}; } else { return {}; } diff --git a/lib/jsdoc/util/markdown.js b/lib/jsdoc/util/markdown.js index 51561a2fc..ec58a5989 100644 --- a/lib/jsdoc/util/markdown.js +++ b/lib/jsdoc/util/markdown.js @@ -153,6 +153,7 @@ function getParseFunction(parserName, conf) { else { logger.error('Unrecognized Markdown parser "%s". Markdown support is disabled.', parserName); + return undefined; } } diff --git a/package.json b/package.json index 5f360040e..9efa7dab7 100644 --- a/package.json +++ b/package.json @@ -21,14 +21,14 @@ "js2xmlparser": "~1.0.0", "marked": "~0.3.5", "requizzle": "~0.2.1", - "strip-json-comments": "~1.0.4", + "strip-json-comments": "~2.0.1", "taffydb": "https://github.com/hegemonic/taffydb/tarball/7d100bcee0e997ee4977e273cdce60bd8933050e", "underscore": "~1.8.3", "wrench": "~1.5.9" }, "devDependencies": { "gulp": "~3.9.1", - "gulp-eslint": "~1.1.1", + "gulp-eslint": "~2.0.0", "gulp-json-editor": "~2.2.1", "istanbul": "~0.4.2", "tv4": "https://github.com/hegemonic/tv4/tarball/own-properties" diff --git a/plugins/sourcetag.js b/plugins/sourcetag.js index cb14beb60..33005fbb0 100644 --- a/plugins/sourcetag.js +++ b/plugins/sourcetag.js @@ -37,7 +37,7 @@ exports.handlers = { try { value = JSON.parse(tag.value); } - catch (e) { + catch (ex) { logger.error('@source tag expects a valid JSON value, like { "filename": "myfile.js", "lineno": 123 }.'); return; } diff --git a/templates/default/publish.js b/templates/default/publish.js index 397718f3c..00e349fad 100644 --- a/templates/default/publish.js +++ b/templates/default/publish.js @@ -239,7 +239,7 @@ function generateSourceFiles(sourceFiles, encoding) { code: helper.htmlsafe( fs.readFileSync(sourceFiles[file].resolved, encoding) ) }; } - catch(e) { + catch (e) { logger.error('Error while generating source file %s: %s', file, e.message); } diff --git a/templates/haruki/publish.js b/templates/haruki/publish.js index 4a44ec264..c1a8e5367 100644 --- a/templates/haruki/publish.js +++ b/templates/haruki/publish.js @@ -1,4 +1,4 @@ -/*eslint no-nested-ternary:0, space-infix-ops: 0 */ +/* eslint no-nested-ternary:0, space-infix-ops: 0 */ /** @overview Builds a tree-like JSON string from the doclet data. @version 0.0.3 diff --git a/test/specs/jsdoc/util/templateHelper.js b/test/specs/jsdoc/util/templateHelper.js index c2cd12078..bbea955d4 100644 --- a/test/specs/jsdoc/util/templateHelper.js +++ b/test/specs/jsdoc/util/templateHelper.js @@ -1,4 +1,4 @@ -/*eslint quotes:0 */ +/* eslint quotes:0 */ 'use strict'; var hasOwnProp = Object.prototype.hasOwnProperty;