summaryrefslogtreecommitdiff
path: root/tools/eslint/lib/rules/newline-after-var.js
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2016-08-06 12:11:02 -0700
committercjihrig <cjihrig@gmail.com>2016-08-10 13:04:27 -0400
commit60ff991c09d61d760e38af5899b5fec3e6a38ee9 (patch)
treecd9762d9851984326b61ac3ec27083ea60897286 /tools/eslint/lib/rules/newline-after-var.js
parent4a8b8048f274eba6ee6283f89d0effac16f59c56 (diff)
downloadnode-new-60ff991c09d61d760e38af5899b5fec3e6a38ee9.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/newline-after-var.js')
-rw-r--r--tools/eslint/lib/rules/newline-after-var.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/eslint/lib/rules/newline-after-var.js b/tools/eslint/lib/rules/newline-after-var.js
index 8801407c0b..cb06c6f261 100644
--- a/tools/eslint/lib/rules/newline-after-var.js
+++ b/tools/eslint/lib/rules/newline-after-var.js
@@ -26,16 +26,16 @@ module.exports = {
create: function(context) {
- var ALWAYS_MESSAGE = "Expected blank line after variable declarations.",
+ let ALWAYS_MESSAGE = "Expected blank line after variable declarations.",
NEVER_MESSAGE = "Unexpected blank line after variable declarations.";
- var sourceCode = context.getSourceCode();
+ let sourceCode = context.getSourceCode();
// Default `mode` to "always".
- var mode = context.options[0] === "never" ? "never" : "always";
+ let mode = context.options[0] === "never" ? "never" : "always";
// Cache starting and ending line numbers of comments for faster lookup
- var commentEndLine = sourceCode.getAllComments().reduce(function(result, token) {
+ let commentEndLine = sourceCode.getAllComments().reduce(function(result, token) {
result[token.loc.start.line] = token.loc.end.line;
return result;
}, {});
@@ -83,7 +83,7 @@ module.exports = {
* @returns {boolean} True if `node` is last of their parent block.
*/
function isLastNode(node) {
- var token = sourceCode.getTokenAfter(node);
+ let token = sourceCode.getTokenAfter(node);
return !token || (token.type === "Punctuator" && token.value === "}");
}
@@ -95,7 +95,7 @@ module.exports = {
* @returns {boolean} True if `token` does not start immediately after a comment
*/
function hasBlankLineAfterComment(token, commentStartLine) {
- var commentEnd = commentEndLine[commentStartLine];
+ let commentEnd = commentEndLine[commentStartLine];
// If there's another comment, repeat check for blank line
if (commentEndLine[commentEnd + 1]) {
@@ -114,7 +114,7 @@ module.exports = {
* @returns {void}
*/
function checkForBlankLine(node) {
- var lastToken = sourceCode.getLastToken(node),
+ let lastToken = sourceCode.getLastToken(node),
nextToken = sourceCode.getTokenAfter(node),
nextLineNum = lastToken.loc.end.line + 1,
noNextLineToken,