[babel] Don't console.error on unknown options
Internally these are considered errors in our pipelines
Lauren Tan committed
Aug 2, 2023 at 12:34 UTC
2d8da0d32dc3b5347689b8b58114d4312dafeb1f
1 file changed
-6
compiler/forget/packages/babel-plugin-react-forget/src/Entrypoint/Options.ts
-6
@@ -108,18 +108,12 @@ export function parsePluginOptions(obj: unknown): PluginOptions {
108
if (obj == null || typeof obj !== "object") {
109
return defaultOptions;
110
}
111
- const invalidOptions: Array<string> = [];
111
let parsedOptions: Partial<PluginOptions> = Object.create(null);
112
for (const [key, value] of Object.entries(obj)) {
113
if (isCompilerFlag(key)) {
114
parsedOptions[key] = value;
116
- } else {
117
- invalidOptions.push(key);
115
}
116
}
120
- if (invalidOptions.length > 0) {
121
- console.error(`Unexpected React Forget compiler flags: ${invalidOptions}`);
122
- }
117
return { ...defaultOptions, ...parsedOptions };
118
}
119