-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Prettier 1.14.2
Playground link
--parser babylonInput:
connect(foo, bar)Output:
connect(
foo,
bar
);Expected behavior:
The functional composition heuristic discussed in #4172 is too broad. If I am not using Redux, the above styling is ugly and annoying. And even if I am using redux, if I don't define mapStateToProps and mapDispatchToProps inline, it's ugly and annoying to split that on multiple lines.
Rather than have prettier assume you are using all libraries, could I not list the libraries I am using in my config file? I'd rather opt in to redux specific styles than have them applied to my non-redux project.
In general though, it seems odd to hard code certain libraries anyway. It will leave prettier in the position of always judging which libraries are popular enough to support, and limits its support for less popular libraries. Why not consider an approach like the one mentioned in this comment? It seems like the eventual solution was proposed in the very next comment and no one really ever replied to this one. I think it would be much better than picking and choosing which libraries get full support.