Created
September 5, 2016 12:40
-
-
Save ares/0b8c9f6bcdac3fd34dd35c6e6b123bdc to your computer and use it in GitHub Desktop.
js linter
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
// original and I'd say very clear for reader | |
if (a) { | |
return 1 | |
} else { | |
return 2 | |
} | |
// vs accepted by linter but duplicates condition keeping it clear when 2 is returned | |
if (a) { | |
return 1 | |
} | |
if (!a) { | |
return 2 | |
} | |
// vs - enforced by linter | |
if (a) { | |
return 1 | |
} | |
return b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment