Merge pull request #106 from demoneaux/fix-directives-newlines

Fix misprinting of directives.
master
James Long 2017-01-11 10:20:09 -05:00 committed by GitHub
commit c2458e7dc9
3 changed files with 20 additions and 1 deletions

View File

@ -524,7 +524,7 @@ function genericPrintNoParens(path, options, print) {
parts.push(
indent(
options.tabWidth,
concat([ line, print(childPath), ";", line ])
concat([ hardline, print(childPath), ";", hardline ])
)
);
},

View File

@ -1,3 +1,17 @@
exports[`test directives.js 1`] = `
"\"use strict\";
function fn() {
\"use strict\";
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\"use strict\";
function fn() {
\"use strict\";
}"
`;
exports[`test optional-type-name.js 1`] = `
"type Foo = (any) => string

View File

@ -0,0 +1,5 @@
"use strict";
function fn() {
"use strict";
}