-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
no-semi comments #1257
no-semi comments #1257
Conversation
In prettier#1257, I discovered that if there's a `""` doc at the end, it's not going to trim the previous one correctly. It also happens to fix a few existing things.
@@ -1112,7 +1112,7 @@ switch (node && node.type) { | |||
case "MethodDefinition": | |||
prop = node.key; | |||
break; | |||
|
|||
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.
This will be fixed by #1259
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
let error = new Error(response.statusText) | ||
// comment | ||
;(error: any).response = response |
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.
yay!
In #1257, I discovered that if there's a `""` doc at the end, it's not going to trim the previous one correctly. It also happens to fix a few existing things.
It doesn't yet work but I think it's close
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.
Nice! Glad that worked. Will it also work for binary expressions, etc (eg, will the leadingComment always be attached to the Expressionstatement instead of child nodes) ?
No, it's not going to work but I can't find any real-world use case where it would be an issue. Can you think of one? |
Thanks, that's helpful. I don't think it's high priority but I'll think
about it...
…On Thu, Apr 13, 2017, 19:31 Christopher Chedeau ***@***.***> wrote:
No, it's not going to work but I can't find any real-world use case where
it would be an issue. Can you think of one?
I can make up examples though:
https://prettier.github.io/prettier/#%7B%22content%22%3A%22%3B(%5Cn%20%20%2F%2F%20a%5Cn%20%201%20-%201)%20*%2010%5Cn%22%2C%22options%22%3A%7B%22printWidth%22%3A80%2C%22tabWidth%22%3A2%2C%22singleQuote%22%3Afalse%2C%22trailingComma%22%3A%22all%22%2C%22bracketSpacing%22%3Atrue%2C%22jsxBracketSameLine%22%3Afalse%2C%22parser%22%3A%22babylon%22%2C%22semi%22%3Afalse%2C%22useTabs%22%3Afalse%2C%22doc%22%3Afalse%7D%7D
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1257 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAq_LgqwJhqYslDHBqZAPibL9d9ex_6Lks5rvtp_gaJpZM4M9Utg>
.
|
Fixes #1245