You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems like the preprocessor.js code should allow any type of babel plugin, both a string and an array of [PLUGIN_NAME: string, PLUGIN_OPTIONS: object], but when adding a plugin with options I get the following error:
$ /home/.../project/node_modules/.bin/prettier -w .
[error] Invalid experimentalBabelParserPluginsList value. Expected an array of a string, but received [["decorators", { decoratorsBeforeExport: true }]].
error Command failed with exit code 1.
When adding these options directly in preprocessor.js like @ShigotoMitame did everything works as expected so it looks liek this is a validation issue caused by prettier's options which don't seem to support any complex values:
* @property {'int' | 'boolean' | 'choice' | 'path'} type
As a work around I was wondering if you would consider supporting taking the plugins directly from a babelrc file, or at least allowing JSON in the experimentalBabelParserPluginsList array to support plugins with options.
Hi @byara (or whoever is working on this now),
Thanks for making and maintaining this plugin!
experimentalBabelParserPluginsList
allows adding custom babel parser plugins, but it does not allow sending plugin options.For example, @ShigotoMitame was using the
decorators
plugin with the following options:It seems like the
preprocessor.js
code should allow any type of babel plugin, both a string and an array of [PLUGIN_NAME: string, PLUGIN_OPTIONS: object], but when adding a plugin with options I get the following error:When adding these options directly in
preprocessor.js
like @ShigotoMitame did everything works as expected so it looks liek this is a validation issue caused by prettier's options which don't seem to support any complex values:https://github.com/prettier/prettier/blob/5909f5b3f191a0a32f759e1f4378477d3b90e28e/src/main/core-options.js#L17
As a work around I was wondering if you would consider supporting taking the plugins directly from a babelrc file, or at least allowing JSON in the experimentalBabelParserPluginsList array to support plugins with options.
Originally posted by @saaryab in #12 (comment)
The text was updated successfully, but these errors were encountered: