-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Labels
lang:javascriptIssues affecting JSIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.
Description
Prettier 1.13.6
Playground link
Input:
this.compose(d1, d2);Output:
this.compose(
d1,
d2
);Expected behavior:
Input code is not reformatted.
As discussed in #4431 (comment) functional composition heuristics produce some unexpected false positives, in part because compose, connect, flow terms are too broad and might relate not only to functional context.
Possible solutions:
- Make sure identifiers are originated from certain packages (probably complex and slow as it requires scope)
- Use code shape instead of identifiers list for heuristics
- At least blacklist obvious edge case, i.e. when
calleeisMemberExpressionand notIdentifier
cc @suchipi
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
lang:javascriptIssues affecting JSIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.