GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||
GeezerVison is showing github.com — tools: always use a trailing comma in arrays by BridgeAR · Pull Request #20703 · nodejs/node Conversation
Member
This makes sure all arrays in /lib end with a comma to prevent Something like this just came up in a review and I guess it is indeed a good idea Checklist
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
This makes sure all arrays in /lib end with a comma to prevent future churn. Other options are set as before to minimize the change.
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
|
There was an error while loading. Please reload this page.
|
CI https://ci.nodejs.org/job/node-test-pull-request-lite/701/ |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@vsemozhetbyt thanks for pointing these out. @nodejs/collaborators I think we shouldd all agree on one way instead of having such comments in reviews. Therefore I suggest a simple vote and hope we can move forward into that direction afterwards: 🎉 No trailing comma at all Be aware that moving to always trailing commas would mean that we have to slowly migrate quite a lot of code. The other way around means little code has to be changed. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@BridgeAR I used 👎 for neither suggestion. I know I once suggested enforcing the If we really want the comma dangle rule, here's my suggestion:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Hmmm...it looks like they either no longer had (or never had?) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I am -1. We already had to work hard in backporting several PRs due to change of linting. We do not need more as a community.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Not a fan of dangling commas, ref #19131 (comment)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I asked in the eslint gitter and while a new option would of course need to be discussed, there was no immediate "no, we don't do consistent-within-a-file" so my original suggestion (implement 'consistent' in eslint and then use that in the nodejs code base) is a potentially viable way to go. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I opened an issue in eslint. I am going to close this now as it is clear that this is not something where we want to go to. Using trailing commas seems like something most people do not want in general as well, so please do not ask for such in reviews. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The one time I wouldn't object to churn and people vote it down... Dangling commas reduce the size of the diff when lines are added. It makes code review a bit easier and is helpful with I'm of the opinion that once eslint adds an option that lets us migrate on a file-by-file basis, we should. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I'm definitely 👍 on having a file-by-file rule. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.