From 3d4baca09e7856fe38893ebc9cd383c1698f5de7 Mon Sep 17 00:00:00 2001 From: Artem Yavorsky Date: Mon, 27 Feb 2017 17:12:02 +0200 Subject: [PATCH] Fix hasBeenWarned condition. (#175) --- src/normalize-options.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/normalize-options.js b/src/normalize-options.js index 10186c7d..b09826e9 100644 --- a/src/normalize-options.js +++ b/src/normalize-options.js @@ -4,8 +4,6 @@ import defaultInclude from "./default-includes"; import moduleTransformations from "./module-transformations"; import pluginFeatures from "../data/plugin-features"; -const hasBeenWarned = false; - const validIncludesAndExcludes = [ ...Object.keys(pluginFeatures), ...Object.keys(moduleTransformations).map((m) => moduleTransformations[m]), @@ -13,6 +11,8 @@ const validIncludesAndExcludes = [ ...defaultInclude ]; +let hasBeenWarned = false; + export const validateIncludesAndExcludes = (opts = [], type) => { invariant( Array.isArray(opts), @@ -76,6 +76,7 @@ export default function normalizeOptions(opts) { `Deprecation Warning: The "whitelist" option has been deprecated in favor of "include" to match the newly added "exclude" option (instead of "blacklist").` ); + hasBeenWarned = true; } invariant(