warnings.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. 'use strict';Object.defineProperty(exports, "__esModule", { value: true });exports.unknownOptionWarning = undefined;var _chalk;
  2. function _load_chalk() {return _chalk = _interopRequireDefault(require('chalk'));}var _utils;
  3. function _load_utils() {return _utils = require('./utils');}function _interopRequireDefault(obj) {return obj && obj.__esModule ? obj : { default: obj };}
  4. const unknownOptionWarning = exports.unknownOptionWarning = (
  5. config,
  6. exampleConfig,
  7. option,
  8. options) =>
  9. {
  10. const didYouMean = (0, (_utils || _load_utils()).createDidYouMeanMessage)(
  11. option,
  12. Object.keys(exampleConfig));
  13. const message =
  14. ` Unknown option ${(_chalk || _load_chalk()).default.bold(`"${option}"`)} with value ${(_chalk || _load_chalk()).default.bold(
  15. (0, (_utils || _load_utils()).format)(config[option]))
  16. } was found.` + (
  17. didYouMean && ` ${didYouMean}`) +
  18. `\n This is probably a typing mistake. Fixing it will remove this message.`;
  19. const comment = options.comment;
  20. const name = options.title && options.title.warning || (_utils || _load_utils()).WARNING;
  21. (0, (_utils || _load_utils()).logValidationWarning)(name, message, comment);
  22. }; /**
  23. * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
  24. *
  25. * This source code is licensed under the MIT license found in the
  26. * LICENSE file in the root directory of this source tree.
  27. *
  28. *
  29. */