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
Consistent object destructuring spacing #2955
Comments
I believe object-curly-spacing should cover this case: http://eslint.org/docs/rules/object-curly-spacing |
So the proposal is a new option on http://eslint.org/docs/rules/object-curly-spacing#options to be |
@xjamundx yes, this would allow us to enforce consistency in an otherwise ambiguous environment where currently anything goes. |
Out of curiosity, why not just pick one style? |
@nzakas semver. We intend to enforce one eventually, but right now, it would break too much code (as standard is used for tests). |
The rule is off by default? |
@mysticatea I was referring to standard's versioning, not eslint. |
@dcousens it sounds like you're asking us to implement a change that you only intend to use temporarily so as not to require a major version bump for standard right now. I don't think that's a good reason for us to make such a change. |
@nzakas I don't think that is true, as the end result is that we may not enforce 1 style XOR** the other. We want to enforce consistent spacing throughout I know this change would also be beneficial for other projects I work on where we want consistency, but also do not enforce 1 style or the other (and nor do those projects use |
ESLint could only enforce consistency within a file. If you don't pick one style you might end with inconsistent styles across all project files. |
We can choose turn the rule on/off each project. |
@lo1tuma I'd rather see
|
@dcousens we generally don't have rules that allow two styles at the same time, as this typically is too confusing for users. Unless someone on the ESLint team wants to champion this change, I'm leaning towards encouraging you to create a custom rule. |
Sure, I think that's totally fair.
|
@xjamundx yes, that would be a great help! want to move the discussion over to standard/standard#182 ? |
Is it possible a rule could be added for the following cases:
Extra options (though less important for my case) could also be to allow strict enforcement over option 1 or option 2 ONLY.
If such a rule already exists, my apologies.
The text was updated successfully, but these errors were encountered: