Configure code formatting to respect linter configuration?

My immediate goal is to configure WebStorm (2018.2.3 on Linux x86_64) to reformat the contents of *.hbs (handlebars / htmlbars = HTML templating language) so that the linter (ember-template-lint) doesn't balk. Ultimately, it'd be much nicer if WebStorm could automatically detect my linter settings and format accordingly.

I found some old posts like these: "Code formatting for template languages" and "How can you set the code style for Handlebars templates?". It seems that the obvious approach is to go to `Settings -> Editor -> Code Style -> HTML` and adjust the options to one's liking. However, there doesn't seem to be enough flexibility for handling handlebars styling rules. For example, one of the rules enforces used of double quotes instead of single quotes but the IDE seems to only help with these if they're in the raw HTML portion, e.g.


<div class='this gets caught / fixed'></div>
<!-- none of the below violations get caught/fixed -->
  baz=(quux 'blah')


Is there any support for this? If not, is there a feature request to add it?

Comment actions Permalink

Normally handlebars formatting should follow HTML code style preferences; but it doesn't seem to work. Logged as, please follow it for updates

Comment actions Permalink

That's a different problem. What I am saying is that (1) there aren't always analogous HTML options and (2) these seem to have to be configured manually. So I am asking for (1) first-class support for HBS parsing / formatting and (2) the ability to detect / import settings from a project's linter configuration.

Comment actions Permalink

Please feel free to create requests for both features in youtrack,


Please sign in to leave a comment.