Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trailing comma setting adjustment #21

Merged
merged 2 commits into from
Mar 24, 2020

Conversation

nathan-contino-mongo
Copy link
Contributor

Our current configuration enforces trailing commas on multi-line constructions. I would suggest that we continue to enforce trailing commas on objects, but omit them from function calls. See my second commit for an example of how trailing commas on function calls can have slightly baffling results.

@@ -40,7 +40,7 @@ async function run() {
}
if (result.upsertedCount === 1) {
console.log(
"Inserted one new document with an _id of " + result.upsertedId._id,
"Inserted one new document with an _id of " + result.upsertedId._id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String interpolation?

Copy link
Contributor

@ccho-mongodb ccho-mongodb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this change to the prettierrc. I think the code examples still need to be updated once this is in place, and that you could use string interpolation syntax in the "usage example" example.

@ccho-mongodb ccho-mongodb merged commit 1150817 into mongodb:master Mar 24, 2020
ccho-mongodb pushed a commit to ccho-mongodb/docs-node that referenced this pull request Sep 23, 2022
* update prettier resource file to keep trailing commas on objects, but not functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants