From 6b276f9c438aded2fe8a76f18542b8b40567a691 Mon Sep 17 00:00:00 2001 From: Sebastian Werner Date: Tue, 4 Jun 2019 13:48:01 +0200 Subject: [PATCH] Lint fixes --- src/getOptions.js | 14 +++++++------- src/shouldPrintComment.js | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/getOptions.js b/src/getOptions.js index 5e5af23..07e245a 100644 --- a/src/getOptions.js +++ b/src/getOptions.js @@ -37,13 +37,13 @@ export default function getOptions(input = {}) { } if (output.target === "auto") { - if (/\btest\b/.test(output.env)) { + if ((/\btest\b/).test(output.env)) { output.target = "node" } - else if (/\bnode\b/.test(output.env)) { + else if ((/\bnode\b/).test(output.env)) { output.target = "node" } - else if (/\bbrowser\b/.test(output.env)) { + else if ((/\bbrowser\b/).test(output.env)) { output.target = "browser" } else { @@ -57,7 +57,7 @@ export default function getOptions(input = {}) { // Auto select test target when running in test environment if (output.transpile === "auto") { - if (/\btest\b/.test(output.env)) { + if ((/\btest\b/).test(output.env)) { output.transpile = "current" if (output.debug) { @@ -73,7 +73,7 @@ export default function getOptions(input = {}) { output.transpile = "node" } - else if (/\bmodern\b/.test(output.env)) { + else if ((/\bmodern\b/).test(output.env)) { output.transpile = "modern" if (output.debug) { @@ -81,7 +81,7 @@ export default function getOptions(input = {}) { } } - else if (/\besm\b/.test(output.env)) { + else if ((/\besm\b/).test(output.env)) { output.transpile = "esm" if (output.debug) { @@ -89,7 +89,7 @@ export default function getOptions(input = {}) { } } - else if (/\bes2015\b/.test(output.env)) { + else if ((/\bes2015\b/).test(output.env)) { output.transpile = "es2015" if (output.debug) { diff --git a/src/shouldPrintComment.js b/src/shouldPrintComment.js index 716a4a9..3d6a851 100644 --- a/src/shouldPrintComment.js +++ b/src/shouldPrintComment.js @@ -1,12 +1,12 @@ export default function shouldPrintComment(comment) { // Keep pure function markers which are generated by some plugins // See sideEffects option: https://github.com/mishoo/UglifyJS2 - if (/[#@]__PURE__/.exec(comment)) { + if ((/[#@]__PURE__/).exec(comment)) { return true } // Keep JSON5 magic comments used for Webpack hints - if (/^\s?webpack[A-Z][A-Za-z]+:/.exec(comment)) { + if ((/^\s?webpack[A-Z][A-Za-z]+:/).exec(comment)) { return true }