-
-
Save s0ber/6b170c51dfbfe7b6532c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The main rule: I want to see a method call. Brackets are the most simple way to make it. | |
# if there is single argument and it is not a string, brackets required | |
fn() | |
fn(1) | |
fn(variable) | |
# if just single string, quotes are some kind of brackets here, and brackets can be omitted | |
fn 'string' | |
# if method is chainable, brackets required | |
fn.addClass('is-string') | |
# if there are more than one arguments, brackets requried | |
fn('string', variable) | |
# if argument doesn't fit one line, brackets can be omitted | |
fn 'string', variable, -> | |
doSomething() | |
fn | |
key: 'value' | |
anotherKey: 'value' | |
# all other cases - brackets required | |
fn('string', variable, anotherFn) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment