sublimetext3js-beautify

JsFormat rule for newline in es6 imports


JsFormat for Sublime Text 3 conforms to most ES6 standards, however, when auto-formatting import statements, it adds a new line to object imports. Here is what the pre-formatted line looks like:

import {func1, func2, func3} from 'some-module';

When auto-formatting, it turns into:

import {
    func1, func2, func3
}
from 'some-module';

Is there a way to disable this kind of formatting?


Solution

  • According to the Github repo, JsFormat uses js-beautify to do the formatting. That project has an open issue where folks complain about various formatting issues, one of them being this very thing. There's a mildly long comment thread which ends in "Pull requests welcome", so unfortunately it looks like there is currently no way to disable this kind of formatting.