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

New: Added option int32Hint for space-infix-ops (fixes #1295) #2067

Merged
merged 1 commit into from
Mar 18, 2015
Merged

New: Added option int32Hint for space-infix-ops (fixes #1295) #2067

merged 1 commit into from
Mar 18, 2015

Conversation

Kirill89
Copy link
Contributor

No description provided.

"var a = b"
"var a = b",
{ code: "a|0", args: [2, { int32Hint: true }] },
{ code: "a |0", args: [2, { int32Hint: true }] }
Copy link
Member

Choose a reason for hiding this comment

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

I think this shouldn't be allowed, the hint should have no spaces before or after the |.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nzakas I think what |0 is a single type cast operator and user can decide how to arrange it. My opinion based on this message.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this shouldn't be allowed, the hint should have no spaces before or after the |.

I see no reasons to remove only half of restrictions, described in #1295. Space before |0 helps sometime to do code more readable, when left part is long. I use both a|0 and (something very long) |0 notations, depending on circumstances.

If someone needs more tuning with additional options - that can be arranged via separate issue & PR.

Copy link
Member

Choose a reason for hiding this comment

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

@puzrin so you are saying spaces before should be allowed?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. |0 should be useable both with and without spaces.

I'm not sure |0 belongs to space-infix-ops at all. Prefer to think, that this patch removes conflicting case to make space-infix-ops useable for opts-reach code.

@nzakas
Copy link
Member

nzakas commented Mar 18, 2015

Okay, LGTM

@nzakas
Copy link
Member

nzakas commented Mar 18, 2015

@Kirill89 can you sign our CLA? http://eslint.org/cla

@Kirill89
Copy link
Contributor Author

@nzakas done.

@nzakas
Copy link
Member

nzakas commented Mar 18, 2015

Thanks

nzakas added a commit that referenced this pull request Mar 18, 2015
New: Added option int32Hint for space-infix-ops (fixes #1295)
@nzakas nzakas merged commit cd4e45d into eslint:master Mar 18, 2015
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 7, 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 7, 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

3 participants