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

Add A Warning for Comma Dangles #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zstickles-gsandf
Copy link

I would like to propose that we start embracing column dangles (also known as trailing commas) in our code.

This allows for much cleaner git diffs and can save us potential errors down the road (alphabetizing lines for example). Check out the diff for this PR to see what I mean...added one line, but it shows as 2 additions and 1 deletion (misleading).

Our transpiler (babel) will strip them out for transpiled code, so we don't need to work about issues with legacy browsers.

We've been trained (or some of us have) to see a trailing comma as bad. However, this is becoming a popular formatting choice by a number of leaders in our space:

@zstickles-gsandf zstickles-gsandf self-assigned this Jan 10, 2018
@zstickles-gsandf
Copy link
Author

We are going to hold off on merging this until we can ensure that it wont break existing code. We would like to use a tool like prettier to format existing repositories, but we are (reasonably) worried that it might break some stuff (styled components is likely to not play well).

Copy link

@stevengrimaldo stevengrimaldo left a comment

Choose a reason for hiding this comment

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

This would make for sure much better PR diffs!

@sunnyzanchi
Copy link
Contributor

Make this an error instead of a warning and bump the version to 2.0.0 and I think this would be 😩 👌 💯 🔥

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