2

I'm using WebStorm code auto formatting and notice that it doesn't format correctly generator functions. I need this:

function* (), function* name()

But WebStorm formats it to this:

function*(), function* name()

There are some settings in WebStorm's code style preferences, but seems like they do not cover this case. Are there any solutions?

2
  • 1
    WebStorm doesn't have any code style options for generator functions, here's a related feature request that you can follow for updates: youtrack.jetbrains.com/issue/WEB-20668 Commented May 17, 2016 at 7:21
  • @EkaterinaPrigara cool, thanks a lot, will follow it! Commented May 17, 2016 at 14:03

1 Answer 1

1

Webstorm does not seem to have this option (my Webstorm 2016.1.2 ignores generator function when formating). A workaround for this problem is a grunt / gulp task that rewrites the files (do a backup first!). So you would use a plugin like gulp-replace to define a task gulp reformat that you call after formatting with Webstorm. Not the best solution, but it should work ;)
However, I would wait for an update.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your answer! However I was thinking there are probably some native ways to change formatting rules, like changing some .idea files or something like that. But anyway we have at least your solution

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.