diff --git a/.eslintrc.js b/.eslintrc.js index 931aab995..4f4bd26a6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -8,6 +8,7 @@ module.exports = { extends: ["eslint:recommended"], plugins: ["prettier"], rules: { + curly: "error", "no-console": "off", "no-inner-declarations": "off", "no-var": "error", diff --git a/src/fast-path.js b/src/fast-path.js index ef5476e51..614704127 100644 --- a/src/fast-path.js +++ b/src/fast-path.js @@ -27,8 +27,9 @@ FastPath.from = function(obj) { // lightweight FastPath [..., name, value] stacks. const copy = Object.create(FastPath.prototype); const stack = [obj.value]; - for (let pp; (pp = obj.parentPath); obj = pp) + for (let pp; (pp = obj.parentPath); obj = pp) { stack.push(obj.name, pp.value); + } copy.stack = stack.reverse(); return copy; } diff --git a/src/printer.js b/src/printer.js index 249b8dbd0..7ff330bd6 100644 --- a/src/printer.js +++ b/src/printer.js @@ -1369,9 +1369,10 @@ function genericPrintNoParens(path, options, print, args) { case "CatchClause": parts.push("catch (", path.call(print, "param")); - if (n.guard) + if (n.guard) { // Note: esprima does not recognize conditional catch clauses. parts.push(" if ", path.call(print, "guard")); + } parts.push(") ", path.call(print, "body")); diff --git a/src/util.js b/src/util.js index e48913948..087391e5a 100644 --- a/src/util.js +++ b/src/util.js @@ -1,7 +1,7 @@ "use strict"; function isExportDeclaration(node) { - if (node) + if (node) { switch (node.type) { case "ExportDeclaration": case "ExportDefaultDeclaration": @@ -11,6 +11,7 @@ function isExportDeclaration(node) { case "ExportAllDeclaration": return true; } + } return false; }