Fix unstable arrow comments (#2262)
It outputted which is completely wrong
```js
<FlatList
renderItem={info => <span>{info.item.widget.missingProp // $FlowExpectedError - bad widgetCount type 6, should be Object
}</span>}
/>;
```
This commit is contained in:
1 parent
438f5887e2
commit
9a55f5b2d6
4 files changed
+29
-3
No files matched your search
+5
-2
@@ -2963,7 +2963,10 @@ function printFunctionParams(path, print, options, expandArg, printTypeParams) {
|
||||
// } b,
|
||||
// }) ) => {
|
||||
// })
|
||||
if (expandArg) {
|
||||
if (
|
||||
expandArg &&
|
||||
!(fun[paramsField] && fun[paramsField].some(n => n.comments))
|
||||
) {
|
||||
return group(
|
||||
concat([
|
||||
docUtils.removeLines(typeParams),
|
||||
@@ -3047,7 +3050,7 @@ function canPrintParamsWithoutParens(node) {
|
||||
!node.rest &&
|
||||
node.params[0].type === "Identifier" &&
|
||||
!node.params[0].typeAnnotation &&
|
||||
!util.hasBlockComments(node.params[0]) &&
|
||||
!node.params[0].comments &&
|
||||
!node.params[0].optional &&
|
||||
!node.predicate &&
|
||||
!node.returnType
|
||||
|
||||
@@ -269,6 +269,13 @@ export const bem = block =>
|
||||
element ? \`__\${css(element)}\` : "",
|
||||
modifier ? \`--\${css(modifier)}\` : ""
|
||||
].join("");
|
||||
|
||||
<FlatList
|
||||
renderItem={(
|
||||
info, // $FlowExpectedError - bad widgetCount type 6, should be Object
|
||||
) => <span>{info.item.widget.missingProp}</span>}
|
||||
data={data}
|
||||
/>
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
/**
|
||||
* Curried function that ends with a BEM CSS Selector
|
||||
@@ -294,6 +301,13 @@ export const bem = block =>
|
||||
modifier ? \`--\${css(modifier)}\` : ""
|
||||
].join("");
|
||||
|
||||
<FlatList
|
||||
renderItem={(
|
||||
info // $FlowExpectedError - bad widgetCount type 6, should be Object
|
||||
) => <span>{info.item.widget.missingProp}</span>}
|
||||
data={data}
|
||||
/>;
|
||||
|
||||
`;
|
||||
|
||||
exports[`currying.js 1`] = `
|
||||
|
||||
@@ -21,3 +21,10 @@ export const bem = block =>
|
||||
element ? `__${css(element)}` : "",
|
||||
modifier ? `--${css(modifier)}` : ""
|
||||
].join("");
|
||||
|
||||
<FlatList
|
||||
renderItem={(
|
||||
info, // $FlowExpectedError - bad widgetCount type 6, should be Object
|
||||
) => <span>{info.item.widget.missingProp}</span>}
|
||||
data={data}
|
||||
/>
|
||||
@@ -243,7 +243,9 @@ function a(/* comment */) {} // comment
|
||||
function b() {} // comment
|
||||
function c(/* comment */ argA, argB, argC) {} // comment
|
||||
call((/*object*/ row) => {});
|
||||
KEYPAD_NUMBERS.map(num => <div />); // Buttons 0-9
|
||||
KEYPAD_NUMBERS.map((
|
||||
num // Buttons 0-9
|
||||
) => <div />);
|
||||
|
||||
`;
|
||||
|
||||
|
||||
Reference in new issue
Block a user