Open seveves opened 7 years ago
I know this has something to do with the esprima parsing infrastructure and it seems it doesn't like the "import" and "export" statements but maybe you have experienced this issue before and can help me. Btw it works with the esprima online parser.
Otherwise I'm going to create an issue at the esprima project.
Kind regards
I've debugged the code and I think the problem is that there is a difference parsing a "script" or a "module". You have to set 'sourceType' to "script" or "module" in the esprima.parse options, f.e. (end of parser.js):
var tree = esprima.parse(code, { attachComment: true, sourceType; 'script' });
When setting it to module my file will be parsed without any errors.
Do you want me to create a PR for this or do you fix it on your own?
This is the error when parsing this file using "closure2ts Clustering.js Clustering.d.ts". Of course this happens with every file containing import statements :)