-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
handeling of ternary based assignment changed in indent #8847
Comments
Thanks for the issue. The indent rule in 3.0 was extremely buggy and so was completely rewritten in v4. The new version of the rule is more strict (the trade off is that it's autofixable now!). That being said, we left the legacy indent rule in for those who prefer the old behavior. You can change |
There's also a proposal to enhance the rule to be able to ignore nodes, which I think would also solve your issue: #8594 |
@kaicataldo Yea, it actually would 😄, thanks for informing me |
Closing this since #8594 exists and is being tracked! |
Tell us about your environment
What parser are you using? babel-eslint (via preset eslint-config-futagozaryuu)
Please show your full configuration:
https://github.com/futagoza/babel-preset-futagozaryuu/blob/master/src/.eslintrc.js
What did you do? Please include the actual source code causing the issue.
https://github.com/futagoza/babel-preset-futagozaryuu/blob/master/src/buildOptions.js#L79
What did you expect to happen?
Before the upgrade to ESLint v4, the rule
ident
allowed the above.What actually happened? Please include the actual, raw output from ESLint.
After the upgrade to ESLint v4, the rule
ident
throws the error:https://travis-ci.org/futagoza/babel-preset-futagozaryuu/builds/248821808
Modifiing the eslint command at the top of the file (for this) returns the orignal behaviour, but I'd prefer not to do this:
/* eslint prefer-const: 0, indent: 0, indent-legacy: ["error", 4, { "SwitchCase": 1 }]*/
Suggestion:
Restore the way
indent
checks ternary based assignments.Add a new boolean option for the
indent
rule calledignoreTernaryAssignment
The text was updated successfully, but these errors were encountered: