Index: lib/Format/UnwrappedLineParser.cpp =================================================================== --- lib/Format/UnwrappedLineParser.cpp +++ lib/Format/UnwrappedLineParser.cpp @@ -1526,7 +1526,8 @@ // class A {} n, m; // will end up in one unwrapped line. // This does not apply for Java. - if (Style.Language == FormatStyle::LK_Java) + if (Style.Language == FormatStyle::LK_Java || + Style.Language == FormatStyle::LK_JavaScript) addUnwrappedLine(); } Index: unittests/Format/FormatTestJS.cpp =================================================================== --- unittests/Format/FormatTestJS.cpp +++ unittests/Format/FormatTestJS.cpp @@ -521,6 +521,8 @@ " return 'y';\n" " }\n" "}"); + verifyFormat("class X {}\n" + "class Y {}"); } TEST_F(FormatTestJS, Modules) {