Last active
March 6, 2021 00:16
-
-
Save alystair/9c393edef88d2bd8d1d6004e0f7db853 to your computer and use it in GitHub Desktop.
Punctuation-first style (comma first style)
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
function foo() { | |
const target = document.getElementById('menu') | |
, debugTarget = document.getElementById('debugMenu') | |
, roles = document.body.classList; | |
return randomBool | |
? someFunction() | |
: someOtherFunction(); | |
} | |
let obj = { | |
foo: 123 | |
, bar: [4,5,6] | |
, someDef: 'someString' | |
, anotherLongProperty: 'fizz buzz' | |
, fizz(){ | |
return true; | |
} | |
, buzz(){ | |
return false; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Benefits
Enforcement
To enforce this style using eslint add the following to your .eslintrc:
"comma-style":[2,"first"]
Gotchas