From 970f8ebaf8dd51ce38b071c69371c677500a0aae Mon Sep 17 00:00:00 2001 From: Artem Yavorsky Date: Tue, 7 Mar 2017 04:41:55 +0200 Subject: [PATCH] Drop whitelist option (#181) --- experimental/babel-preset-env/README.md | 2 -- .../babel-preset-env/src/normalize-options.js | 21 ++----------------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/experimental/babel-preset-env/README.md b/experimental/babel-preset-env/README.md index bea0910d8e..189930b5a5 100644 --- a/experimental/babel-preset-env/README.md +++ b/experimental/babel-preset-env/README.md @@ -146,8 +146,6 @@ Outputs the targets/plugins used and the version specified in [plugin data versi `Array`, defaults to `[]`. -> NOTE: `whitelist` is deprecated and will be removed in the next major in favor of this. - An array of plugins to always include. Valid options include any of the [babel plugins](https://github.com/babel/babel-preset-env/blob/master/data/plugin-features.js) or [built-ins](https://github.com/babel/babel-preset-env/blob/master/data/built-in-features.js), such as `transform-es2015-arrow-functions`, `map`, `set`, or `object.assign`. diff --git a/experimental/babel-preset-env/src/normalize-options.js b/experimental/babel-preset-env/src/normalize-options.js index 4ceaeecc0d..0c7ba71711 100644 --- a/experimental/babel-preset-env/src/normalize-options.js +++ b/experimental/babel-preset-env/src/normalize-options.js @@ -12,8 +12,6 @@ const validIncludesAndExcludes = [ ...defaultInclude ]; -let hasBeenWarned = false; - export const validateIncludesAndExcludes = (opts = [], type) => { invariant( Array.isArray(opts), @@ -82,27 +80,12 @@ export const getElectronChromeVersion = (electronVersion) => { }; export default function normalizeOptions(opts) { - // TODO: remove whitelist in favor of include in next major - if (opts.whitelist && !hasBeenWarned) { - console.warn( - `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( - !(opts.whitelist && opts.include), - `Invalid Option: The "whitelist" and the "include" option are the same and one can be used at - a time` - ); - - checkDuplicateIncludeExcludes(opts.whitelist || opts.include, opts.exclude); + checkDuplicateIncludeExcludes(opts.include, opts.exclude); return { debug: opts.debug, exclude: validateIncludesAndExcludes(opts.exclude, "exclude"), - include: validateIncludesAndExcludes(opts.whitelist || opts.include, "include"), + include: validateIncludesAndExcludes(opts.include, "include"), loose: validateLooseOption(opts.loose), moduleType: validateModulesOption(opts.modules), targets: opts.targets,