-
-
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
New: Added option int32Hint for space-infix-ops (fixes #1295) #2067
Conversation
"var a = b" | ||
"var a = b", | ||
{ code: "a|0", args: [2, { int32Hint: true }] }, | ||
{ code: "a |0", args: [2, { int32Hint: true }] } |
There was a problem hiding this comment.
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 |
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Okay, LGTM |
@Kirill89 can you sign our CLA? http://eslint.org/cla |
@nzakas done. |
Thanks |
New: Added option int32Hint for space-infix-ops (fixes #1295)
No description provided.