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]) {
|
||||
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 =
|
||||
COMMON_VALIDATORS[key] ||
|
||||
|
||||
@ -296,12 +296,6 @@ describe("api", function() {
|
||||
development: {
|
||||
passPerPreset: true,
|
||||
presets: [pushPreset("argthree"), pushPreset("argfour")],
|
||||
env: {
|
||||
development: {
|
||||
passPerPreset: true,
|
||||
presets: [pushPreset("argfive"), pushPreset("argsix")],
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
@ -327,8 +321,6 @@ describe("api", function() {
|
||||
"fourteen;",
|
||||
"fifteen;",
|
||||
"sixteen;",
|
||||
"argfive;",
|
||||
"argsix;",
|
||||
"argthree;",
|
||||
"argfour;",
|
||||
"seven;",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user