import-js
import-js copied to clipboard
Unable to import files when using smart pipeline operator
I have my project set up to use the smart pipeline operator via the babel/plugin-proposal-pipeline-operator
plugin. When I'm in a file using this operator, importjs fails to import my modules with an error.
Here's an example of a file:
export function mapDouble(array) {
return array |> _.map(#, x => x * 2);
}
When I run importjs fix source/javascript/example.js
, I get the following error:
{
"messages": [
"SyntaxError: Primary Topic Reference found but pipelineOperator not passed 'smart' for 'proposal' option. (2:24)"
],
"fileContent": "export function mapDouble(array) {\n return array |> _.map(#, x => x * 2);\n}\n",
"unresolvedImports": {}
}
This code works fine inside my app, but not with importjs. Here's my .babelrc
:
{
"presets": [ "babel-preset-react-app" ],
"plugins": [
[ "@babel/plugin-proposal-pipeline-operator", { "proposal": "smart" } ]
]
}
Thanks!