max-mapper / standard-format

converts your code into Standard JavaScript Format
264 stars 59 forks source link

does not support async functions #109

Closed jonathanong closed 7 years ago

jonathanong commented 9 years ago

can't format my babel code because async functions are not supported :(

feross commented 9 years ago

ES6 support in esformatter is currently a bit lacking. As ES6 support improves in esformatter, standard-format will inherit those fixes.

nickpoorman commented 9 years ago

+1 for async/await support

haywirez commented 8 years ago

Any updates on this one?

sheerun commented 8 years ago

same

sheerun commented 8 years ago

Maybe you could switch to eslint for auto formatting?

dotcypress commented 8 years ago

Standart-format works fine with async functions. But we have bug in dependency: https://github.com/millermedeiros/esformatter-semicolon-first/issues/3

For quick fix, just comment this line

cyberwombat commented 8 years ago

That dependency issue just got fixed btw. Current master now works for formatting. The linter however is still borked which prevents the formatter from working

feross commented 8 years ago

@cyberwombat How is the linter borked? You should be using babel-eslint with standard if you want ES6+ support. See http://standardjs.com/#can-i-use-a-custom-js-parser-for-bleeding-edge-es6-or-es7-support

feross commented 8 years ago

Also -- it may interest the folks who are following this issue to know that standard v8 is shipping with a new --fix option that is backed by eslint itself. So far in testing it works MUCH better than standard-format which is backed by a separate project, esformatter.

Give it a shot!

npm install -g standard@beta
standard --fix
cyberwombat commented 8 years ago

@feross I mean the linter has not caught up. I am using sublimelinter-contrib-standard - I tried using another linter but the formatter and the other linters never seemed to agree on what is correct - . This linter does however it still marks async/await as invalid though the formatter has no issue with it anymore. Because the formatter fails on the async/await its a bit hard to lint and format. I will try your suggestions.

feross commented 7 years ago

You should use standard --fix instead of this package. standard-format isn't being actively maintained anymore.

sheerun commented 7 years ago

@feross Pro tip: remove issues section