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

Issue with ESLint v2 or v1` transform + sourceType: module #117

Open
DrewML opened this issue Apr 29, 2016 · 3 comments
Open

Issue with ESLint v2 or v1` transform + sourceType: module #117

DrewML opened this issue Apr 29, 2016 · 3 comments

Comments

@DrewML
Copy link

DrewML commented Apr 29, 2016

Hoping this isn't just an obvious case of user-error on my part.

Can be seen at: http://astexplorer.net/#/DH4gO9Bvjr

image

image

@fkling
Copy link
Owner

fkling commented Apr 29, 2016

I have a hunch what the issue is: The transform (eslint) and the parser (espree) are actually completely separate. The parser settings really only affect the parser, which is used to show the tree in the top right panel. ESLint uses its own instance of the parser, with its own settings.

I agree with you that the parser settings should also be used for the transform tool. What prevents us from doing that right now is

  • Parser settings are pretty much internal to the parser module itself. Even though we write the settings of every parser to local storage, I have to take a closer look if transform tools could simply read them from local storage without much post-processing (meaning that the settings might stored in a different format than what the transform tool needs).
  • Even though we switch to the preferred parser when a transform tool is selected, one is free to choose another one afterwards (e.g. you could switch to traceur). This isn't necessarily a problem, since eslint could simply always read the espree parser settings from local storage, but that might also be surprising. Maybe we should just prevent people from switching parsers when a tool is selected to avoid confusion.

The way parser settings are handled is not ideal at the moment. I want to merge #111 soon and then work on improving parser settings (e.g. change them so that they are passed to the parser, which would also make it easier to pass them to the transform tool).

@DrewML
Copy link
Author

DrewML commented Apr 29, 2016

Cool - that makes sense. Thanks for clarifying.

@kentcdodds
Copy link
Contributor

This appears to have come back or still be a problem. How can I help?

kentcdodds pushed a commit to kentcdodds/astexplorer that referenced this issue Apr 19, 2017
fkling pushed a commit that referenced this issue May 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants