-
Notifications
You must be signed in to change notification settings - Fork 140
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
ESLint with Google style warning on properly formatted code #58
Comments
In particular, eslint's error here appears to violate the acceptable styles listed in https://google.github.io/styleguide/javascriptguide.xml#Code_formatting ("Function arguments' section). |
Yeah, there are a lot of cases where code that's valid according to Google style will show errors with this ESLint config. It's a trade-off between being overly strict and way too lax. PR #50 add indentation rules based on the suggestion in #12 (comment). Previously there was no indentation enforcement (so your code wouldn't error), but that also meant someone using tabs wouldn't get an error either. This felt like a good compromise. You can turn off the |
Currently using: 'indent': ['error', 2, {'CallExpression': {'arguments': 2}, 'ignoredNodes': ['CallExpression > CallExpression', 'CallExpression > MemberExpression']}] which works for our code for now. I'm a little surprised that I need to put the |
Same issue here, it seems that google ESlint is requiring a 4 space indention when you go to a newline for a function parameter...really weird. |
You can fix it using: |
The following code is unchanged by
clang-format --style=Google
:However, running it with ESLint gives the errors:
ESLint apparently wants the lines above to be:
This seems inconsistent with clang-format's concept of ContinuationIndentWidth. Is there a workaround for this? Or is my setup wrong? The contents of my .eslintrc are:
(I was directed here from eslint/eslint#12083)
The text was updated successfully, but these errors were encountered: