Enable Trailing Comma Rule in Prettier - #51451
Merged
Merged
Conversation
megcrenshaw
marked this pull request as ready for review
April 21, 2023 12:43
levadadenys
approved these changes
Apr 21, 2023
levadadenys
left a comment
Contributor
There was a problem hiding this comment.
LGTM!
@molly-moen , @code-dot-org/studentlearning , you might wanna also take take a look
bencodeorg
approved these changes
Apr 21, 2023
bencodeorg
left a comment
Contributor
There was a problem hiding this comment.
Definitely felt a little skeptical off the bat, but the article you shared (and the fact that it's a default!) sold me. Thanks for doing this!
molly-moen
approved these changes
Apr 21, 2023
molly-moen
left a comment
Contributor
There was a problem hiding this comment.
That article convinced me too, I'm in favor!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As part of Molly's upgrade to Prettier (2.8.7) #51065, we now have an override to disable the trailing comma rule
code-dot-org/apps/.prettierrc.js
Line 4 in a295f25
The default value for the trailing comma rule changed as part of the Prettier upgrade https://prettier.io/docs/en/options.html#trailing-commas to "es5":
This PR removes the override to use the default value and updates existing files with the automated
--fixfeature. When I first removed the override, I ranbundle exec rake lint:javascriptand gotI then ran
yarn lint:js -- --fixwhich yieldedI committed those files, all of which were in the
appsdirectory, and then ranbundle exec rake lint:javascriptagain and got no errors.Links
Argument to enable trailing commas: https://medium.com/@nikgraf/why-you-should-enforce-dangling-commas-for-multiline-statements-d034c98e36f8
Testing story
Deployment strategy
Follow-up work
Privacy
Security
Caching
PR Checklist: