Closed okonet closed 9 years ago
Object rest/spread is a proposal for ES7 (https://github.com/sebmarkbage/ecmascript-rest-spread) and wallaby currently only supports ES6. All I can suggest for now as a workaround is not to use experimental ES7 features (they may actually change in future), and use alternative ES6 features. For example, this should work (in the latest wallaby version):
let [ type, className, isSelected, ...rest ] = this.props
Having said that, I'm happy to support ES7 in wallaby. Here is the current situation: babel does support some ES7 features and wallaby is using the same code parser as babel (https://github.com/babel/acorn-babel), but wallaby needs to generated instrumented code before babel preprocessor and it uses escodegen fork (https://github.com/wallabyjs/escodegen) to do that. Escodegen doesn't yet support ES7, that's the only thing required in order to support ES7 in wallaby. I am happy to accept PR requests to https://github.com/wallabyjs/escodegen with ES7 code support. What's basically required is to add a few generate functions to support ES7 AST elements, such as SpreadProperty (in your example).
Actually I was hoping to have webpack me covered since I use the --experimental
flag in webpack config. But the webpack's loaders doesn't seem to be working either... But I guess this is how wallaby works, using it's own parser and not the webpack's processed output.
Yes, wallaby has to instrument the original code, not the processed one, to provide the code coverage correctly (source maps data is not enough for doing the coverage).
@okonet Now it is supported via compilers https://github.com/wallabyjs/public#compilers-setting
:+1: Thanks! I'll take a look
Not sure if this is wallaby-webpack related or should be reported in wallaby-public.
Following code is failing to be parsed:
Error message:
Failed to parse js/modules/global/EntityComponent.jsx, SyntaxError: Unexpected token (37:43)
I'm using following preprocessor: