-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Code style #4
Comments
I'm a BIG proponent of an auto-formatter, too. https://github.com/angular/clang-format is one direction we could go.. now that it does support JS. |
I'm mostly okay with the Google style. My only pref is to stick to 80 chars. Longer than that tends to unreadable code. |
#5 adds base Google style eslint checking. A couple of issues to address. Biggest thing is There are a handful of things that may need some bikeshedding. |
Remaining eslint warnings for current code:
|
investigated clang-format today. For posterity's sake, you can recreate my results with something like
and then run with output is...OK. It does some screwy things with object and array literals and arrow functions, sometimes putting lots of things on one line and sometimes not. There may be an additional rule to fix those that I'm missing, but I couldn't find it. It's nice to have a tool that fixes a bunch of style issues automatically, but not sure if it's worth it. |
I'd prefer sticking with something like .eslintrc, just because that's what the majority of people use. Ideally people from the community can and should contribute as they wish, and the less ... unusual the better imo. |
Yup exactly that's where things are settling.
|
yeah, just to be clear, the hope was to be able to configure clang-format so that it would fix violations of the exact same rules as in the .eslintrc file, so it would be an option for those who e.g. need a robot to hit the semicolon key for them. Looks like clang-format is too pushy on other fronts for that to work out, though. |
groovy. i think we're set. |
I think we want Blink style for the JS. What do others think?
Perhaps we can extend https://github.com/google/eslint-config-google
I'd be happy with a line length max > 110 though. :)
The text was updated successfully, but these errors were encountered: