Skip to content
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

Fix: Make MemberExpression option opt-in (fixes #6797) #6798

Merged
merged 1 commit into from Aug 1, 2016

Conversation

Trott
Copy link
Contributor

@Trott Trott commented Jul 29, 2016

What issue does this pull request address?

#6797

What changes did you make? (Give an overview)

Turn MemberExpression option of the indent rule to be off by default.

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

The MemberExpression option should be opt-in as it is a breaking
change.

@eslintbot
Copy link

LGTM

@markelog
Copy link
Member

LGTM

@markelog
Copy link
Member

But this should be for #6795? If I understand you correctly

@Trott
Copy link
Contributor Author

Trott commented Jul 29, 2016

Fix for 6795 is "ignore assignment statements". Fix for 6797 is "make it
opt in". These are not mutually exclusive fixes. I recommend doing both.
On Fri, Jul 29, 2016 at 3:57 PM Oleg Gaidarenko notifications@github.com
wrote:

But this should be for #6795
#6795? If I understand you
correctly


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#6798 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAr4M28fDVhPA3GZvheec99QTqsMK7Unks5qaoVpgaJpZM4JYnIt
.

@markelog
Copy link
Member

But both PRs are sent to fix one "breaking change", but okay, I understand the logic behind it

@@ -97,7 +97,7 @@ module.exports = {
const: DEFAULT_VARIABLE_INDENT
},
outerIIFEBody: null,
MemberExpression: 1
MemberExpression: null
Copy link
Member

Choose a reason for hiding this comment

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

We like to keep options as all the same data type, so null isn't appropriate for this.

Copy link
Contributor Author

@Trott Trott Jul 30, 2016

Choose a reason for hiding this comment

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

Would -1 be appropriate? EDIT: Whoops, ignore. You address this indirectly below. Just don't set it to anything at all. Got it.

Copy link
Member

Choose a reason for hiding this comment

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

@nzakas why there is a null value for outerIIFEBody? Should we change that too in another PR?

@nzakas
Copy link
Member

nzakas commented Jul 30, 2016

@Trott I appreciate the diligence, but it's confusing having two issues. Let's refocus on #6795 and add all relevant information there.

The `MemberExpression` option should be opt-in as it is a breaking
change.
@eslintbot
Copy link

LGTM

@Trott
Copy link
Contributor Author

Trott commented Jul 30, 2016

Comment from @nzakas addressed (I think), commit squashed, branch force pushed.

@nzakas
Copy link
Member

nzakas commented Jul 30, 2016

Lgtm, just waiting to let others review.

@gyandeeps
Copy link
Member

LGTM, waiting for others to review.

@@ -1428,7 +1441,7 @@ ruleTester.run("indent", rule, {
{
code: fixture,
output: fixedFixture,
options: [2, {SwitchCase: 1}],
options: [2, {SwitchCase: 1, MemberExpression: 1}],
Copy link
Member

@markelog markelog Jul 31, 2016

Choose a reason for hiding this comment

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

Why there is sometimes spaces after/before {/} and sometimes not?

This remark shouldn't block this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This inconsistency seems to exist throughout the file.

For example, SwitchCase without a space happens on lines 266, 537, 542, and ten additional places.

But SwitchCase with a space occurs in lines 776 and 1897.

If the inconsistency is something that should be fixed eventually, maybe I can leave as is for this PR and I or someone else can open up a separate issue about this? Might be a good one to apply the beginner label to.

Copy link
Member

Choose a reason for hiding this comment

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

The style guide seems to prefer object literals never being on one line in the first place, and so doesn't express an opinion about spaces after curly braces. I'll create an issue asking for clarification on that point. It might be that we can enable object-curly-spacing in this repository if we can reach consensus.

Copy link
Member

Choose a reason for hiding this comment

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

hm, could one of you create an issue about it? I think it would be good if our code should be as consistent as possible so it could be kinda of an example how things should look like?

@markelog
Copy link
Member

We usually need two "LGTM" right?

LGTM

@gyandeeps gyandeeps merged commit c7488ac into eslint:master Aug 1, 2016
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@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 Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants