Skip to content

Conversation

yeonjuan
Copy link
Member

@yeonjuan yeonjuan commented Dec 7, 2019

What is the purpose of this pull request? (put an "X" next to item)

[ ] Documentation update
[x] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

What changes did you make? (Give an overview)
fix #11414
make it ignore aligning single line properties.

Is there anything you'd like reviewers to focus on?

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Dec 7, 2019
@kaicataldo kaicataldo added accepted There is consensus among the team that this change meets the criteria for inclusion autofix This change is related to ESLint's autofixing capabilities bug ESLint is working incorrectly rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Dec 10, 2019
Copy link
Member

@kaicataldo kaicataldo left a comment

Choose a reason for hiding this comment

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

Thanks for working on this!

@yeonjuan yeonjuan requested a review from kaicataldo December 14, 2019 03:01
Copy link
Member

@kaicataldo kaicataldo left a comment

Choose a reason for hiding this comment

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

I'm not sure this fixes the problem in full (see comments). That being said, I recognize that the behavior I'm suggesting below is a lot more work. I would be fine with landing this as-is because it's passing through the options and does seem like an improvement 👍

output: [
"var obj = {",
" foo : 1,",
" 'bar' : 2, baz : 3, longlonglong: 4",
Copy link
Member

Choose a reason for hiding this comment

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

I understand why this is the way it is, but I wonder if this actually makes sense?

Feels like it should be:

var obj = {
    foo  : 1,
    'bar': 2, baz: 3, longlonglong: 4
};

or

var obj = {
    foo: 1, 'bar'       : 2,
    baz: 3, longlonglong: 4
};

output: [
"var obj = {",
" foo : 1,",
" 'bar' : 2, baz : 3,",
Copy link
Member

@kaicataldo kaicataldo Dec 14, 2019

Choose a reason for hiding this comment

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

Same comment as above.

Copy link
Member Author

Choose a reason for hiding this comment

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

@kaicataldo
Yes, I agree :) Can I work on that in different PR?.

Copy link
Member

@btmills btmills left a comment

Choose a reason for hiding this comment

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

Also fine landing as-is. Thanks for delving into this rule, @yeonjuan!

@btmills btmills merged commit c5c7086 into eslint:master Dec 20, 2019
@yeonjuan yeonjuan deleted the fix-only-single-line branch January 3, 2020 14:50
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Jun 19, 2020
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Jun 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion autofix This change is related to ESLint's autofixing capabilities bug ESLint is working incorrectly rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

key-spacing + align: 'value' + jsx objects becomes ugly sometimes
3 participants