-
Notifications
You must be signed in to change notification settings - Fork 813
Add Linting #293
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
Add Linting #293
Conversation
I haven't squashed the commits to make it easier to review, but can do so before merging. |
0633ff7
to
0b10b56
Compare
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.
Awesome PR! Hope my comments make sense.
} | ||
}; | ||
}, | ||
static afterClose = () => { |
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.
Should be preferable to declare as function instead of assign a anonymous function to a variable?
static afterClose() {...}
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.
Sounds good, fixed.
handleKeyDown: function(event) { | ||
if (event.keyCode == 9 /*tab*/) scopeTab(this.refs.content, event); | ||
if (event.keyCode == 27 /*esc*/) { | ||
handleKeyDown = (event) => { |
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.
Declare as function?
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.
Changing it here doesn't work because we want the arrow functions binding. See section 5 of this blog post for more info.
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.
Ok.
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.
Thanks for sharing this. I completely forgot that arrow function are bounded to the current instance.
this.shouldClose = false; | ||
}, | ||
} |
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.
Same above?
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.
Yep, but same response as last time too :)
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.
:)
el.focus(); | ||
}, 0); | ||
} | ||
} | ||
|
||
exports.markForFocusLater = function() { | ||
exports.markForFocusLater = function markForFocusLater () { |
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.
It can be written as...
export function markForFocusLater() { ... }
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.
oops, I think export
keyword must be enabled. So, it can be setup or keep the exports.markForFocusLater
.
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.
Hmm... can't believe I missed that. I'll fix it right up :)
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.
Added 2 more comments, but I'll approve (just because I'm reviewing :) ) in case you want to address those comments later .
|
||
module.exports = findTabbableDescendants; | ||
function findTabbableDescendants (element) { |
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.
export function findTabbableDescendants (element) {
|
||
module.exports = function(node, event) { | ||
var tabbable = findTabbable(node); | ||
module.exports = function scopeTab (node, event) { |
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.
export function scopeTab (node, event) {
0b10b56
to
c481226
Compare
@diasbruno Alright... I've addressed all your changes :) |
* Add linting * Make specs pass linter * Make lib/helpers pass linter * Make lib/components pass linter This also does some signfiicant refactoring of the code to appease the linter's pro-ES2015+ stance. closes reactjs#289 closes reactjs#286 * Make travis run the lint task as well as specs closes reactjs#284
* Add linting * Make specs pass linter * Make lib/helpers pass linter * Make lib/components pass linter This also does some signfiicant refactoring of the code to appease the linter's pro-ES2015+ stance. closes reactjs#289 closes reactjs#286 * Make travis run the lint task as well as specs closes reactjs#284
* Add linting * Make specs pass linter * Make lib/helpers pass linter * Make lib/components pass linter This also does some signfiicant refactoring of the code to appease the linter's pro-ES2015+ stance. closes reactjs#289 closes reactjs#286 * Make travis run the lint task as well as specs closes reactjs#284
Fixes #284
Changes proposed:
Acceptance Checklist:
CONTRIBUTING.md
.