summaryrefslogtreecommitdiff
path: root/tools/eslint/lib/rules/no-empty-function.js
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2016-08-06 12:11:02 -0700
committerRich Trott <rtrott@gmail.com>2016-08-09 21:19:02 -0700
commite313c0286b1c1a7267516a7b2b4c01fa76c71ec0 (patch)
tree7358ae3f4af0979c124eca46d734314df40a6bc6 /tools/eslint/lib/rules/no-empty-function.js
parent49e473a45fb3e13fdd4588c6241b71bbac4fe5ab (diff)
downloadnode-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/no-empty-function.js')
-rw-r--r--tools/eslint/lib/rules/no-empty-function.js18
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/eslint/lib/rules/no-empty-function.js b/tools/eslint/lib/rules/no-empty-function.js
index 0102acff51..d7d8c2e886 100644
--- a/tools/eslint/lib/rules/no-empty-function.js
+++ b/tools/eslint/lib/rules/no-empty-function.js
@@ -9,7 +9,7 @@
// Helpers
//------------------------------------------------------------------------------
-var ALLOW_OPTIONS = Object.freeze([
+let ALLOW_OPTIONS = Object.freeze([
"functions",
"arrowFunctions",
"generatorFunctions",
@@ -19,7 +19,7 @@ var ALLOW_OPTIONS = Object.freeze([
"setters",
"constructors"
]);
-var SHOW_KIND = Object.freeze({
+let SHOW_KIND = Object.freeze({
functions: "function",
arrowFunctions: "arrow function",
generatorFunctions: "generator function",
@@ -44,8 +44,8 @@ var SHOW_KIND = Object.freeze({
* "constructors".
*/
function getKind(node) {
- var parent = node.parent;
- var kind = "";
+ let parent = node.parent;
+ let kind = "";
if (node.type === "ArrowFunctionExpression") {
return "arrowFunctions";
@@ -78,7 +78,7 @@ function getKind(node) {
}
// Detects prefix.
- var prefix = "";
+ let prefix = "";
if (node.generator) {
prefix = "generator";
@@ -118,10 +118,10 @@ module.exports = {
},
create: function(context) {
- var options = context.options[0] || {};
- var allowed = options.allow || [];
+ let options = context.options[0] || {};
+ let allowed = options.allow || [];
- var sourceCode = context.getSourceCode();
+ let sourceCode = context.getSourceCode();
/**
* Reports a given function node if the node matches the following patterns.
@@ -136,7 +136,7 @@ module.exports = {
* @returns {void}
*/
function reportIfEmpty(node) {
- var kind = getKind(node);
+ let kind = getKind(node);
if (allowed.indexOf(kind) === -1 &&
node.body.type === "BlockStatement" &&