Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sourceType: "module" with ES5 target? #459

Closed
dead-claudia opened this issue Sep 5, 2016 · 4 comments
Closed

sourceType: "module" with ES5 target? #459

dead-claudia opened this issue Sep 5, 2016 · 4 comments

Comments

@dead-claudia
Copy link
Contributor

It'd be helpful with Rollup, if you don't want to use Babel. Related to eslint/espree#289.

@dead-claudia
Copy link
Contributor Author

I filed it in both places because this is an Acorn limitation that also requires some support on Espree's end. (I use ESLint.)

@RReverser
Copy link
Member

Various source types is a feature that is present only in ES6. It would be a violation of grammar to just rip apart some features from various versions and concatenate together, and no one would really want to support such custom flavor of JavaScript.

Please see #343, #241 and I believe there were few other related issues for previous discussions on this.

@ryanelian
Copy link

I am trying to write a script validator which returns true when a module is written in ES5 (to be consumed by webpack, which obviously must be a module).

Seeing that this issue was closed two years ago, is there any way today to do this with acorn?

@dead-claudia
Copy link
Contributor Author

@ryanelian Just walk the parsed AST, checking against a whitelist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants