| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Review requested:
|
Sorry, something went wrong.
|
This LGTM, but a possibility to consider: We get nits on the docs by people removing trailing commas from time to time. And that's with only having trailing commas in a few places! It's an atypical coding style. I'm fine with turning it on, and in the unlikely event that we end up with an avalanche of confused readers, we can turn it off again (in docs only). |
Sorry, something went wrong.
|
@Trott fwiw in the wider JS world, i'm pretty confident it's almost universal to enforce trailing commas on any multiline construct, to minimize diff churn |
Sorry, something went wrong.
|
I don't know how much the diff churn argument matters for documentation examples. I totally get that those who like trailing commas would want them here and elsewhere for consistency, but looking at documentation of individual functions, for example, I personally don't think it helps readability: import {
setTimeout,
} from 'timers/promises'; |
Sorry, something went wrong.
What makes you say it is "almost universal to enforce trailing commas"? ESLint's comma-dangle rule is enabled as part of their "recommended" rules. It defaults to prohibiting all dangling commas. The standard package prohibits all dangling commas. I could go on, but that should really be enough to make it clear that dangling commas are definitely not "almost universal". On the contrary, it's a pretty strong indicator that dangling commas are atypical. |
Sorry, something went wrong.
Sorry, something went wrong.
|
The airbnb style guide, and prettier i believe, have required them for many many years, which constitute far more usage than the eslint recommended config - but fair counterpoint, and certainly it’s not worth arguing about it :-) |
Sorry, something went wrong.
PR-URL: #45471 Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
PR-URL: #45471 Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
PR-URL: #45471 Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
| Back | FazBrowse Home | New Git URL |
No description provided.