I believe this falls under the feature request category. Sometimes I use newlines to break long chained method calls into logical groups for (IMO) added clarity. I would like for prettier to preserve these newlines.
EDIT: I apologize if this has been discussed or reported before, I tried to search the issues but there are quite a few to go through.
Input:
angular.module('AngularAppModule')
// Constants.
.constant('API_URL', 'http://localhost:8080/api')
// App configuration.
.config(appConfig)
.run(appRun);
Output:
angular
.module('AngularAppModule')
// Constants.
.constant('API_URL', 'http://localhost:8080/api')
// App configuration.
.config(appConfig)
.run(appRun);
Expected:
angular
.module('AngularAppModule')
// Constants.
.constant('API_URL', 'http://localhost:8080/api')
// App configuration.
.config(appConfig)
.run(appRun);
As far as I see it, there are two ways to go about this:
- Only allow a newline before a comment
- Always allow one newline between chained method calls
Arguably, this is not a make-it-or-break-it feature, but one I would like to see implemented.
Reproduction link
I believe this falls under the feature request category. Sometimes I use newlines to break long chained method calls into logical groups for (IMO) added clarity. I would like for prettier to preserve these newlines.
EDIT: I apologize if this has been discussed or reported before, I tried to search the issues but there are quite a few to go through.
Input:
Output:
Expected:
As far as I see it, there are two ways to go about this:
Arguably, this is not a make-it-or-break-it feature, but one I would like to see implemented.
Reproduction link