Disallow nested '.env' blocks since they are useless.
This commit is contained in:
parent
a89171910f
commit
db28c18458
@ -206,6 +206,9 @@ export function validate(type: OptionsType, opts: {}): ValidatedOptions {
|
|||||||
if (type !== "arguments" && ROOT_VALIDATORS[key]) {
|
if (type !== "arguments" && ROOT_VALIDATORS[key]) {
|
||||||
throw new Error(`.${key} is only allowed in root programmatic options`);
|
throw new Error(`.${key} is only allowed in root programmatic options`);
|
||||||
}
|
}
|
||||||
|
if (type === "env" && key === "env") {
|
||||||
|
throw new Error(`.${key} is not allowed inside another env block`);
|
||||||
|
}
|
||||||
|
|
||||||
const validator =
|
const validator =
|
||||||
COMMON_VALIDATORS[key] ||
|
COMMON_VALIDATORS[key] ||
|
||||||
|
|||||||
@ -296,12 +296,6 @@ describe("api", function() {
|
|||||||
development: {
|
development: {
|
||||||
passPerPreset: true,
|
passPerPreset: true,
|
||||||
presets: [pushPreset("argthree"), pushPreset("argfour")],
|
presets: [pushPreset("argthree"), pushPreset("argfour")],
|
||||||
env: {
|
|
||||||
development: {
|
|
||||||
passPerPreset: true,
|
|
||||||
presets: [pushPreset("argfive"), pushPreset("argsix")],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@ -327,8 +321,6 @@ describe("api", function() {
|
|||||||
"fourteen;",
|
"fourteen;",
|
||||||
"fifteen;",
|
"fifteen;",
|
||||||
"sixteen;",
|
"sixteen;",
|
||||||
"argfive;",
|
|
||||||
"argsix;",
|
|
||||||
"argthree;",
|
"argthree;",
|
||||||
"argfour;",
|
"argfour;",
|
||||||
"seven;",
|
"seven;",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user