-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Reformat the output somehow #35
Comments
A more radical approach is we can just rewrite the entire code generator based on Babel or escodegen -- that is, generating an AST instead of JS code directly. Something like babel-template makes it less painful than it would appear at first. |
Oh yes. babel-template looks awesome. I originally wanted to avoid building ASTs due to the verbosity, but this might just be perfect. |
It's worth noting that the original domenic/webidl-class-generator did something similar using Traceur's babel-template counterpart. See e.g. https://github.com/domenic/webidl-class-generator/blob/master/lib/code-generation.js |
For direct source-to-source prettification, https://github.com/jlongster/prettier is the new hotness. |
OK, so I did the prettier part of this. That was easy. Remaining tasks until I personally am happy:
But I want to delay these until landing #33 as I don't want to make @TimothyGu rebase unnecessarily on any lint fixes and reformatting. So this is on hold for a little bit. |
I'm not sure if we want to put ESLint in webidl2js's |
Since webidl2js is mostly a |
Also add a bunch of tests. On the road to fixing jsdom#35.
On the road to fixing jsdom#35.
Also add a bunch of tests. On the road to fixing jsdom#35.
On the road to fixing jsdom#35.
Also add a bunch of tests. On the road to fixing jsdom#35.
On the road to fixing jsdom#35.
On the road to fixing jsdom#35.
On the road to fixing jsdom#35.
I guess this is indeed good enough as-is. |
The indentation is already not perfect, and #33 is going to add more imperfect indentation.
It would be ideal if while writing webidl2js, we could just ignore the indentation issues (or use whichever looks nicer inside the webidl2js source code), then have a postprocessing step that reformats everything for us. Maybe eslint's fix option, or maybe something simpler based on just esprima.
The text was updated successfully, but these errors were encountered: