-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Fix handling of new keyword and call signatures and improve type parameter formatting #1491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -0,0 +1,13 @@ | |||
interface Interface { | |||
< | |||
Voila, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it 😄
function printTypeParameters(path, options, print, paramsKey) { | ||
const n = path.getValue(); | ||
|
||
// In flow, Foo<> is acceptable. In TypeScript, it's a syntax error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's a syntax error, shouldn't we never get here in the first place?
@@ -1,3 +1,4 @@ | |||
node_modules | |||
npm-debug.log | |||
/test.js | |||
/.vscode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you could configure your editor to add trailing empty lines that would be great!
@@ -3,6 +3,6 @@ | |||
exports[`cunstructorType.ts 1`] = ` | |||
var d: new(x: number) => void; | |||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |||
var d: new(x: number) => void; | |||
var d: new (x: number) => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the whitespace here intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. new
is a keyword, so the space helps distinguish it from a method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I just wanted to make sure that it wasn't a mistake.
interface<T> {}
new <T>(): any
andnew <T> => any
<T>() => any
and<T>(): any