Comments can cause inconsistent output
See original GitHub issueIn a project I work on, there is a common stanza at the top of most files that has been implemented inconsistently. If there are comments, the prettier output is also inconsistent:
angular.module('foo').directive('bar', function() {});
angular
.module('foo').directive('bar', function() {});
angular
.module('foo')
.directive('bar', function() {});
angular
.module('foo')
// the directive
.directive('bar', function() {});
angular
// the mod
.module('foo')
// the directive
.directive('bar', function() {});
Output:
angular.module('foo').directive('bar', function() {});
angular.module('foo').directive('bar', function() {});
angular.module('foo').directive('bar', function() {});
angular.module('foo')// the directive
.directive('bar', function() {});
angular
// the mod
.module('foo')
// the directive
.directive('bar', function() {});
I probably would have expected consistently either of these:
angular.module('foo').directive('bar', function() {});
// or
angular
.module('foo')
.directive('bar', function() {});
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Comments make code formatting inconsistent #4209 - GitHub
After recent changes to the way we format multiline code, comments are now providing weird/inconsistent formatting results depending on how ...
Read more >Comment.Add in Word VBA (2019) is inconsistent in adding ...
Problem: The comment balloon is always added, but it is frequently left blank. On some documents, every comment will work (1/10 maybe). On ......
Read more >Reducing outdated and inconsistent code comments during ...
comments make the code easier to read and maintain, code comments can become outdated and inconsistent with their corresponding code.
Read more >Excel 2016 bug/inconsistent behaviour when pasting comments
I've encountered an issue when copying and pasting cells containing comments in Excel 2016. The problem is repeatable and can be duplicated ...
Read more >What To Say In A Performance Review [Comments, Phrases ...
Below we'll outline exactly what to say in a performance review—including performance review comments, phrases, and questions—so you can ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have a project where prettier consistently produces inconsistent output…
code looks like:
and every time I run prettier, the format changes (adds and removes a newline)
@vjeux the first and second versions are just there for reference, the 3rd and 4th illustrate how the comments alter the output.