1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, '__esModule', {
|
4 | value: true
|
5 | });
|
6 | exports.unknownOptionWarning = void 0;
|
7 |
|
8 | function _chalk() {
|
9 | const data = _interopRequireDefault(require('chalk'));
|
10 |
|
11 | _chalk = function () {
|
12 | return data;
|
13 | };
|
14 |
|
15 | return data;
|
16 | }
|
17 |
|
18 | var _utils = require('./utils');
|
19 |
|
20 | function _interopRequireDefault(obj) {
|
21 | return obj && obj.__esModule ? obj : {default: obj};
|
22 | }
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | const unknownOptionWarning = (config, exampleConfig, option, options, path) => {
|
31 | const didYouMean = (0, _utils.createDidYouMeanMessage)(
|
32 | option,
|
33 | Object.keys(exampleConfig)
|
34 | );
|
35 | const message =
|
36 | ` Unknown option ${_chalk().default.bold(
|
37 | `"${path && path.length > 0 ? path.join('.') + '.' : ''}${option}"`
|
38 | )} with value ${_chalk().default.bold(
|
39 | (0, _utils.format)(config[option])
|
40 | )} was found.` +
|
41 | (didYouMean && ` ${didYouMean}`) +
|
42 | `\n This is probably a typing mistake. Fixing it will remove this message.`;
|
43 | const comment = options.comment;
|
44 | const name = (options.title && options.title.warning) || _utils.WARNING;
|
45 | (0, _utils.logValidationWarning)(name, message, comment);
|
46 | };
|
47 |
|
48 | exports.unknownOptionWarning = unknownOptionWarning;
|