-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jaydson
committed
Dec 9, 2014
1 parent
0197de5
commit 7979276
Showing
7 changed files
with
234 additions
and
226 deletions.
There are no files selected for viewing
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 file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
var localconfig = require('../config'), | ||
helpers = require('../helpers'), | ||
clc = helpers.cliColor(), | ||
logo = '\n' + | ||
import { version } from '../config'; | ||
import { cliColor } from '../helpers'; | ||
|
||
var clc = cliColor(), | ||
logo = clc.message('\n' + | ||
'|_| _ _ _ _ _ _ . _ \n' + | ||
'| |(_|| | | |(_)| ||(_ \n' + | ||
' ' + localconfig.version + ' \n'; | ||
' ' + version + ' \n'); | ||
|
||
module.exports = clc.message(logo); | ||
export default logo; |
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
Oops, something went wrong.
7979276
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.
//cc @UltCombo
please make a review when you're able.
7979276
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.
LGTM, nice work! 👍
Though, I'm not sure if it is a good idea to replace all regular functions with arrow functions. We must be wary that arrow functions implicitly
return
the value of the last expression, and this may bring unexpected side-effects.Also, our JSCS rules only allow a single
var
keyword per scope (requireMultipleVarDecl: "onevar"
), while this commit does the complete opposite withlet
(as if we haddisallowMultipleVarDecl
forlet
). We should make this consistent, either bothvar
andlet
declarations have to be joined or should never be joined together.7979276
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 don't think this is true.
When we have a function body we must to explicitly
return
the value we want.Example:
Arrow function have implicitly
return
when we don't have a function body:Please correct me if i missed something.
7979276
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.
About
let
andvar
what you suggest?I totally agree we need consistency in our code style.
7979276
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.
You're completely right, my bad. A quick test on Nightly console shows you're right:
I still confuse ES6 arrow functions with CoffeScript's fat arrows, which do implicit
return
the last expression's value when there is no explicit return as the last statement of the function. (e.g. demo). Thankfully ES6 is saner than that. 😉7979276
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.
👍
7979276
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.
Well, these code style decisions are mostly personal opinion, so I'm not sure. The way you wrote looks fine to me, and that also follows Google's code style guide (no multiple declaration).