Add group around TSMethodSignature (#2037)

This ensures that the comment size is not taken into account during measurement

Fixes #1976
master
Christopher Chedeau 2017-06-07 14:20:55 -07:00 committed by GitHub
parent 09f147decd
commit b730f4eccf
3 changed files with 18 additions and 1 deletions

View File

@ -2453,7 +2453,7 @@ function genericPrintNoParens(path, options, print, args) {
if (n.typeAnnotation) {
parts.push(": ", path.call(print, "typeAnnotation"));
}
return concat(parts);
return group(concat(parts));
case "TSNamespaceExportDeclaration":
if (n.declaration) {
// Temporary fix until https://github.com/eslint/typescript-eslint-parser/issues/263

View File

@ -9,6 +9,19 @@ abstract interface I {}
`;
exports[`comments.js 1`] = `
interface ScreenObject {
// I make things weird.
at(point: Point): Screen | undefined;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
interface ScreenObject {
// I make things weird.
at(point: Point): Screen | undefined;
}
`;
exports[`separator.ts 1`] = `
declare module 'selenium-webdriver' {
export const until: {

View File

@ -0,0 +1,4 @@
interface ScreenObject {
// I make things weird.
at(point: Point): Screen | undefined;
}