diff options
-rw-r--r-- | lib/utils/config/definitions.js | 6 | ||||
-rw-r--r-- | tap-snapshots/test-lib-utils-config-describe-all.js-TAP.test.js | 4 | ||||
-rw-r--r-- | test/lib/utils/config/definitions.js | 4 |
3 files changed, 8 insertions, 6 deletions
diff --git a/lib/utils/config/definitions.js b/lib/utils/config/definitions.js index 3b6d61583..67a830448 100644 --- a/lib/utils/config/definitions.js +++ b/lib/utils/config/definitions.js @@ -29,6 +29,8 @@ const buildOmitList = obj => { const only = obj.only if (/^prod(uction)?$/.test(only) || obj.production) omit.push('dev') + else if (obj.production === false) + include.push('dev') if (/^dev/.test(obj.also)) include.push('dev') @@ -1396,8 +1398,8 @@ define('preid', { }) define('production', { - default: false, - type: Boolean, + default: null, + type: [null, Boolean], deprecated: 'Use `--omit=dev` instead.', description: 'Alias for `--omit=dev`', flatten (key, obj, flatOptions) { diff --git a/tap-snapshots/test-lib-utils-config-describe-all.js-TAP.test.js b/tap-snapshots/test-lib-utils-config-describe-all.js-TAP.test.js index cfb34dfad..a85f90ac8 100644 --- a/tap-snapshots/test-lib-utils-config-describe-all.js-TAP.test.js +++ b/tap-snapshots/test-lib-utils-config-describe-all.js-TAP.test.js @@ -1338,8 +1338,8 @@ Alias for --include=optional or --omit=optional #### \`production\` -* Default: false -* Type: Boolean +* Default: null +* Type: null or Boolean * DEPRECATED: Use \`--omit=dev\` instead. Alias for \`--omit=dev\` diff --git a/test/lib/utils/config/definitions.js b/test/lib/utils/config/definitions.js index 75819dcbc..b6e1d1d01 100644 --- a/test/lib/utils/config/definitions.js +++ b/test/lib/utils/config/definitions.js @@ -310,9 +310,9 @@ t.test('flatteners that populate flat.omit array', t => { definitions.production.flatten('production', obj, flat) t.strictSame(obj, { production: false, - include: [], + include: ['dev'], omit: [], - }, '--no-production has no effect') + }, '--no-production explicitly includes dev') t.strictSame(flat, { omit: [] }, '--no-production has no effect') obj.production = true |