Fix duplicate comments in classes (#1349)

Turns out, you can't blindly print this node. We need a deeper fix but let's revert this fix for now.

Fixes #1348
master
Christopher Chedeau 2017-04-19 11:59:23 -07:00 committed by GitHub
parent bc53920734
commit 007cfd9179
3 changed files with 26 additions and 5 deletions

View File

@ -2119,11 +2119,7 @@ function printMethod(path, options, print) {
group(
concat([
path.call(function(valuePath) {
return comments.printComments(
path,
p => printFunctionParams(valuePath, print, options),
options
)
return printFunctionParams(valuePath, print, options);
}, "value"),
path.call(p => printReturnType(p, print), "value")
])

View File

@ -1,5 +1,23 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`class.js 1`] = `
class x {
/**
* Set of default settings to be applied to model fetch calls in DAO layer.
*/
static get defaultSettings() {
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class x {
/**
* Set of default settings to be applied to model fetch calls in DAO layer.
*/
static get defaultSettings() {}
}
`;
exports[`empty_paren_comment.js 1`] = `
let f = (/* ... */) => {}
(function (/* ... */) {})(/* ... */)

View File

@ -0,0 +1,7 @@
class x {
/**
* Set of default settings to be applied to model fetch calls in DAO layer.
*/
static get defaultSettings() {
}
}