can we add support for the acorn options sourceType and ecmaVersion?
sourceType: Indicate the mode the code should be parsed in. Can be either "script" or "module". This influences global strict mode and parsing of import and export declarations.
ecmaVersion
Indicates the ECMAScript version to parse. Must be either 3, 5, 6 (2015), 7 (2016), or 8 (2017). This influences support for strict mode, the set of reserved words, and support for new syntax features. Default is 7. [acorn]
This would allow us to annotate code with es6 modules like in the following snippet:
Hi,
can we add support for the acorn options sourceType and ecmaVersion?
This would allow us to annotate code with es6 modules like in the following snippet:
Currently if only need
sourcetype: "module"
but i thought it would be a good idea to supportecmaversion
too. What do you think?Cheers, Fabian
CC @loxy