diff options
author | Rich Trott <rtrott@gmail.com> | 2016-08-06 12:11:02 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2016-08-09 21:19:02 -0700 |
commit | e313c0286b1c1a7267516a7b2b4c01fa76c71ec0 (patch) | |
tree | 7358ae3f4af0979c124eca46d734314df40a6bc6 /tools/eslint/lib/rules/valid-jsdoc.js | |
parent | 49e473a45fb3e13fdd4588c6241b71bbac4fe5ab (diff) | |
download | node-new-e313c0286b1c1a7267516a7b2b4c01fa76c71ec0.tar.gz |
tools: update to ESLint 3.2.2
PR-URL: https://github.com/nodejs/node/pull/7999
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Johan Bergström <bugs@bergstroem.nu>
Diffstat (limited to 'tools/eslint/lib/rules/valid-jsdoc.js')
-rw-r--r-- | tools/eslint/lib/rules/valid-jsdoc.js | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tools/eslint/lib/rules/valid-jsdoc.js b/tools/eslint/lib/rules/valid-jsdoc.js index 65ed539d55..8af117e30e 100644 --- a/tools/eslint/lib/rules/valid-jsdoc.js +++ b/tools/eslint/lib/rules/valid-jsdoc.js @@ -8,7 +8,7 @@ // Requirements //------------------------------------------------------------------------------ -var doctrine = require("doctrine"); +let doctrine = require("doctrine"); //------------------------------------------------------------------------------ // Rule Definition @@ -61,7 +61,7 @@ module.exports = { create: function(context) { - var options = context.options[0] || {}, + let options = context.options[0] || {}, prefer = options.prefer || {}, sourceCode = context.getSourceCode(), @@ -78,7 +78,7 @@ module.exports = { //-------------------------------------------------------------------------- // Using a stack to store if a function returns or not (handling nested functions) - var fns = []; + let fns = []; /** * Check if node type is a Class @@ -110,7 +110,7 @@ module.exports = { * @private */ function addReturn(node) { - var functionState = fns[fns.length - 1]; + let functionState = fns[fns.length - 1]; if (functionState && node.argument !== null) { functionState.returnPresent = true; @@ -148,8 +148,8 @@ module.exports = { * @private */ function getCurrentExpectedTypes(type) { - var currentType; - var expectedType; + let currentType; + let expectedType; if (type.name) { currentType = type.name; @@ -177,8 +177,8 @@ module.exports = { return; } - var typesToCheck = []; - var elements = []; + let typesToCheck = []; + let elements = []; switch (type.type) { case "TypeApplication": // {Array.<String>} @@ -223,7 +223,7 @@ module.exports = { * @private */ function checkJSDoc(node) { - var jsdocNode = sourceCode.getJSDocComment(node), + let jsdocNode = sourceCode.getJSDocComment(node), functionData = fns.pop(), hasReturns = false, hasConstructor = false, @@ -336,7 +336,7 @@ module.exports = { } // check the parameters - var jsdocParams = Object.keys(params); + let jsdocParams = Object.keys(params); if (node.params) { node.params.forEach(function(param, i) { @@ -344,7 +344,7 @@ module.exports = { param = param.left; } - var name = param.name; + let name = param.name; // TODO(nzakas): Figure out logical things to do with destructured, default, rest params if (param.type === "Identifier") { @@ -363,7 +363,7 @@ module.exports = { } if (options.matchDescription) { - var regex = new RegExp(options.matchDescription); + let regex = new RegExp(options.matchDescription); if (!regex.test(jsdoc.description)) { context.report(jsdocNode, "JSDoc description does not satisfy the regex pattern."); |