From 1b056d482bdf623e8e09e46932f982942035b2e7 Mon Sep 17 00:00:00 2001 From: vhashimotoo Date: Sun, 13 Jun 2021 02:11:15 +0300 Subject: [PATCH] fix(plugin-electronegativity): add parserPlugins option --- .../electronegativity/src/ElectronegativityPlugin.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/plugin/electronegativity/src/ElectronegativityPlugin.ts b/packages/plugin/electronegativity/src/ElectronegativityPlugin.ts index 1787bffd1e..f168b29816 100644 --- a/packages/plugin/electronegativity/src/ElectronegativityPlugin.ts +++ b/packages/plugin/electronegativity/src/ElectronegativityPlugin.ts @@ -49,6 +49,12 @@ export type ElectronegativityConfig = { * from Electron 7 to Electron 8. */ electronUpgrade?: string; + /** + * Specify additional parser plugins to use. For example, `optionalChaining`. + * + * Defaults to empty array (`[]`) + */ + parserPlugins: Array; }; export default class ElectronegativityPlugin extends PluginBase { @@ -64,6 +70,7 @@ export default class ElectronegativityPlugin extends PluginBase { await runElectronegativity({ ...this.config, + parserPlugins: this.config.parserPlugins ?? [], input: options.outputPaths[0], }, true); }